https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119071
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- So the place where this match pattern happens is: _16 = a.0_1 == -2; # RANGE [irange] int [0, 1] MASK 0x1 VALUE 0x0 _17 = (intD.6) _16; # RANGE [irange] int [-1, 0] _12 = -_17; # RANGE [irange] int [0, 1] _4 = _12 + 1; Applying pattern match.pd:6831, gimple-match-5.cc:5943 Applying pattern match.pd:1684, gimple-match-10.cc:11535 Applying pattern match.pd:2224, gimple-match-4.cc:1093 Applying pattern match.pd:2145, gimple-match-5.cc:13205 Applying pattern match.pd:5297, gimple-match-2.cc:7854 Applying pattern match.pd:3921, gimple-match-4.cc:1544 gimple_simplified to _8 = a.0_1 != -2; _15 = (int) _8; _4 = _15; So this looks correct.