[Bug tree-optimization/98906] [8/9/10/11 Regression] Miscompiles code even at -O1
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Feb 1 00:36:47 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98906
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Yes the code is undefined/unspecified.
quo_lo in one case does not fit into the range of unsigned int while quo_high
does not fit into the range of int. So you need to first cast to int64_t (long
or long long) and then cast to uint32_t for this code to be well defined.
More information about the Gcc-bugs
mailing list