This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/77292] Spurious warning: logical not is only applied to the left hand side of comparison


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

--- Comment #9 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to M Welinder from comment #3)
> I am not aware of a rule that requires the compiler to ignore context
> when considering warnings.  It certainly does consider context when
> it issues "might be used uninitialized" warnings, so why not here?

Wuninitialized warnings are implemented in the middle-end. They benefit from
the analysis done by optimization, but also suffer from the optimizations
transforming and removing code (PR18501 and
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings).

Warnings in the FE, like this one, are more consistent but there is very
limited analysis done in the FE (because it is harder to implement in the FE,
it may slow down the compiler and would duplicate the analysis done in the
middle-end for optimization).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]