diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc index 07e0fd6827afcd1d95b35b6671bad1f56587dc92..c3c5bce42dfe7464f0854a57087bd4ca20253370 100644 --- a/gcc/tree-ssa-structalias.cc +++ b/gcc/tree-ssa-structalias.cc @@ -2775,8 +2775,15 @@ solve_graph (constraint_graph_t graph) continue; /* If the node has changed, we need to process the - complex constraints and outgoing edges again. */ - if (bitmap_clear_bit (changed, i)) + complex constraints and outgoing edges again. For complex + constraints that modify i itself, like the common group of + callarg = callarg + UNKNOWN; + callarg = *callarg + UNKNOWN; + *callarg = callescape; + make sure to iterate immediately because that maximizes + cache reuse and expands the graph quickest, leading to + better visitation order in the next iteration. */ + while (bitmap_clear_bit (changed, i)) { unsigned int j; constraint_t c; @@ -2794,7 +2801,7 @@ solve_graph (constraint_graph_t graph) ??? But we shouldn't ended up with "changed" set ... */ if (vi->oldsolution && bitmap_bit_p (vi->oldsolution, anything_id)) - continue; + break; bitmap_copy (pts, get_varinfo (find (anything_id))->solution); } else if (vi->oldsolution) @@ -2803,7 +2810,7 @@ solve_graph (constraint_graph_t graph) bitmap_copy (pts, vi->solution); if (bitmap_empty_p (pts)) - continue; + break; if (vi->oldsolution) bitmap_ior_into (vi->oldsolution, pts);