https://gcc.gnu.org/g:ea739c61a0b3838062617ef118cb431afb5d7948
commit r17-4994-gea739c61a0b3838062617ef118cb431afb5d7948 Author: Richard Biener <[email protected]> Date: Thu Oct 8 13:03:53 2026 +0200 tree-optimization/127758 - PTA unit () can fail As unite () can fail we have to properly guard side-effects. The followup patch will introduce additional failures, so be prepared. PR tree-optimization/127758 * pta-andersen.cc (scc_visit): Do not merge when unite fails. (find_equivalent_node): Likewise. Diff: --- gcc/pta-andersen.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gcc/pta-andersen.cc b/gcc/pta-andersen.cc index bba34b3c9a0f..e8cb77020a68 100644 --- a/gcc/pta-andersen.cc +++ b/gcc/pta-andersen.cc @@ -959,8 +959,8 @@ scc_visit (constraint_graph_t graph, class scc_info *si, unsigned int n) } else { - unite (lowest_node, i); - graph->indirect_cycles[i - FIRST_REF_NODE] = lowest_node; + if (unite (lowest_node, i)) + graph->indirect_cycles[i - FIRST_REF_NODE] = lowest_node; } } bitmap_set_bit (si->deleted, lowest_node); @@ -1977,8 +1977,10 @@ find_equivalent_node (constraint_graph_t graph, { /* Unify the two variables since we know they are equivalent. */ if (unite (graph->eq_rep[label], node)) - unify_nodes (graph, graph->eq_rep[label], node, false); - return graph->eq_rep[label]; + { + unify_nodes (graph, graph->eq_rep[label], node, false); + return graph->eq_rep[label]; + } } else {
