https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93013
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- >For input x=-2^31 y=-1, the result is expected to be 0. NO. The result is undefined as I mentioned in comment #2 and #3. If you want it defined, then check y == -1 && y != 0 before doing the % operations.