https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81281
--- Comment #5 from rguenther at suse dot de <rguenther at suse dot de> --- On Mon, 4 Dec 2017, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81281 > > --- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- > Created attachment 42785 > --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42785&action=edit > gcc8-pr81281-test.patch > > This was fixed by r251651 for -fsanitize=undefined. Attaching testcase in > patch form. That said, without -fsanitize=unreachable the bug is still > latent. > If we start just with: > int a = (int) (-2024172551 - (long long)ci); > then we properly fold it into: > int a = (int) (2270794745 - (unsigned int) ci); Yeah, those sanitize_flags_p (SANITIZE_SI_OVERFLOW) "fixes" are always wrong... The 2nd hunk looks ok though