https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110269
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org Status|NEW |ASSIGNED --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- It does handle GIMPLE_COND. What the change did was avoid using GENERIC fold_const and instead resort to match.pd only. I can't see how it arrived at folding it before. We (now) have Visiting PHI node: _15 = PHI <a.3_11(2), 6(5)> Argument #0 (2 -> 7 executable) a.3_11 Value: CONSTANT a.3_11 Argument #1 (5 -> 7 executable) 6 Value: CONSTANT 6 PHI node value: VARYING Lattice value changed to VARYING. Adding SSA edges to worklist. so there's no nonzero bits info. The input to CCP2 is almost the same: int main () { - int D.2014; + int D.2786; int _1; int * * d.0_2; int * b.1_3; @@ -46,7 +46,7 @@ __assert_fail (); <bb 7> [local count: 1073458354]: - # RANGE ~[0, 0] + # RANGE [irange] int [-INF, -1][1, +INF] # _15 = PHI <a.3_11(2), 6(5)> _20 = _15; _1 = _20; so it looks like range representation changes make a difference here? Ah, so match.pd lacks a simple (ne @0 integer_zerop) check using tree_single_nonzero_warnv_p. We have (simplify (cmp (convert? addr@0) integer_zerop) (if (tree_single_nonzero_warnv_p (@0, NULL)) { constant_boolean_node (cmp == NE_EXPR, type); }))