https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61867
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to David Binderman from comment #3) > I think that all that needs to happen is a warning is produced > where either the detection or reduction takes place. There is no single place, it's a result of constant propagation and a whole range of optimisations cooperating. Those optimisations are a good thing, you don't want to spit out a warning every time the compiler decides it can remove part of the code, you'd end up with either hundreds of warnings for correct code or disabling all optimisations. > As ever, users are free to ignore warnings. egrep -v is > useful, I find. egrep is useless for ignoring warnings. It might help on the command line, but not if you run the compiler from an editor or IDE, or with -Werror etc. Just because you don't mind ignoring warnings doesn't mean it is appropriate for GCC to start spitting out poor quality warnings.