[Bug c++/80825] Result of a right-shift of a signed negative number
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri May 19 08:44:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80825
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Your computation on x overflows and signed overflow invokes undefined behavior.
Use -fwrapv or use an unsigned type for the overflowing computation.
More information about the Gcc-bugs
mailing list