https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91699

--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
I don't yet fully understand the interplay between LTO and the late warning (or
other middle-end) options to tell how difficult that problem might be to fix. 
At Cauldron Jeff mentioned other problems in this area, such as LTO suppressing
-Wall even when it's on the command line during compilation, or different
translation units (or even functions via #pragma GCC diagnostic) being compiled
with different warning options that LTO is expected to somehow merge when
inlining.  It does sound tricky.

But -Wstringop-truncation shouldn't be any more noisy for Fotran code than it
is for C, so the most expedient "fix"for this bug will probably be to correct
the warning to handle the Fortran MEM_REFs (if it's wrong).  This shouldn't be
too hard if I can reproduce the problem without LTO (even without the warning
itself).  The checker still runs, it just doesn't emit any warnings (without
LTO), so I can work with that.

The general issue of the interaction between middle-end warning options and LTO
can be dealt with separately.

Reply via email to