https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61240
--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 43162 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43162&action=edit gcc8-pr61240.patch The C FE doesn't do this optimization anymore, but c_fully_fold does because the generic folding code folds it. This should fix that. Can't reproduce warning with C++.