https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94899
rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |easyhack
Status|RESOLVED |NEW
Last reconfirmed| |2020-05-01
CC| |rsandifo at gcc dot gnu.org
Resolution|INVALID |---
Ever confirmed|0 |1
--- Comment #4 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org>
---
Reopening because...
(In reply to Andrew Pinski from comment #2)
> This is invalid as 0x80000000 is unsigned (C90/C++03) or long (C99/C++11) in
> type.
> Which means then overflow is not undefined but rather wrapping.
It's unsigned int for C99/C++11 too (see the different handling of
decimal-literals and other integer-literals in [lex.icon.type]).
This means that the result of the addition is also unsigned,
For the specific value of 0x80000000, the transformation is monotonic,
so the optimisation is valid and well-defined.