[Bug sanitizer/116031] signed integer overflow check at optimization level -O3
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 22 15:43:15 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116031
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
int32_t s;
int32_t *n = &s;
uint32_t o = 1912123656;
c(*n >> (*l + (int32_t)o >= 0));
First off s is uninitialized. So it being 0 is valid and 0 shifted by any value
is still 0 so the overflow add is optimized away.
More information about the Gcc-bugs
mailing list