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.