https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119984
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to saul.x.robinson from comment #4) > I know the integer overflows. > Does that sort of undefined behavior cause issues with the final machine > code the compiler generates? Yes. In this case if you are adding 2 positive numbers together, GCC assume they always be positive (due to undefined behavior of integer overflow) so it will remove the and of the sign bit off because GCC assumes it will always be 0 as it is still positive.