https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101913
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- >-1L << 63 is LONG_MIN No it is undefined and has an overflow bit on it. You want (long)(-1UL << 63) for it be correct. But the warning is still there. I thought -fsanitize=undefined enabled -fwrapv too ...