http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55936
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-11 13:36:29 UTC --- Patch at http://gcc.gnu.org/ml/gcc-patches/2013-01/msg00592.html even though it produces way more useful ranges regresses FAIL: g++.dg/tree-ssa/pr18178.C -std=gnu++98 scan-tree-dump-times vrp1 "if " 1 FAIL: g++.dg/tree-ssa/pr18178.C -std=gnu++11 scan-tree-dump-times vrp1 "if " 1 because for asserts: Visiting statement: i_18 = ASSERT_EXPR <i_1, i_1 < _5>; Intersecting [-INF, _5 + -1] EQUIVALENCES: { i_1 } (1 elements) and [0, 1] to [0, 1] EQUIVALENCES: { i_1 } (1 elements) Found new range for i_18: [0, 1] when we do not choose the range 0 as fallback we lose it completely (there is no equivalence SSA name we can add to the set of equivalences). Later this causes i_19: [0, +INF] EQUIVALENCES: { i_1 i_18 } (2 elements) ... -_21: [i_18 + 1, +INF] EQUIVALENCES: { _5 } (1 elements) +_21: [1, +INF] EQUIVALENCES: { _5 } (1 elements) ... Folding statement: if (i_19 >= _21) -Folding predicate i_19 >= _21 to 0 -Folded into: if (0 != 0) - +Not folded as we can fold i_18 >= i_18 + 1 orginally. Leaving for 4.9, as fixing this requires equivalence reorg or use of one of the equivalences when propagating (which is problematic as the comment in vrp_visit_cond_stmt suggests).