https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100477
--- Comment #9 from andysem at mail dot ru --- (In reply to Martin Sebor from comment #8) > > Submitting a bug for the LTO problem is only helpful if it comes with a test > case to reproduce it. I have heard about problems suppressing warnings in > LTO builds but I'm not aware of it being a design limitation, and other than > the mention of the inlining caveat (the -Wstringop-overflow example) I can't > find it mentioned in the LTO section of the manual pointed to by the link. The warning is very likely appearing as a result of inlining, and since the compiler inlines based on its own decisions it is difficult to create a test case that would reproduce the problem. The bottom line is that diagnostic pragmas don't work (reliably) with LTO, and fixing that requires the compiler to track pragmas past inlining.