https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61867
--- Comment #3 from David Binderman <dcb314 at hotmail dot com> --- (In reply to Jonathan Wakely from comment #1) > I'm pretty sure gcc does detect it and optimizes appropriately, it just > doesn't warn. I've checked the output from using -S and I agree. All the code to do the detection & reduction seems to be in place. I think that all that needs to happen is a warning is produced where either the detection or reduction takes place. As ever, users are free to ignore warnings. egrep -v is useful, I find.