https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95190
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- This is new behavior for warnings in GCC 10 and now how all other optimization options behave - the option state is fixed per function at compile-time and carried over to link-time. Indeed warning options are not mentioned in the docs, let me fix that.