https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102661
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Signed integer overflow is undefined. You need to either use -fwrapv which defines it as wrapping or you need to use unsigned typea to do the arithmetical operations or you need to do the overflow detection differently.