https://gcc.gnu.org/g:0b2d3bfa38ccce0dda46aba023f64440cc638496
commit r15-3853-g0b2d3bfa38ccce0dda46aba023f64440cc638496 Author: Richard Biener <rguent...@suse.de> Date: Tue Sep 24 14:21:33 2024 +0200 Disable add_store_equivs when -fno-expensive-optimizations IRAs add_store_equivs is quadratic in the size of the function worst case, disable it when -fno-expensive-optimizations which means at -O1 and -Og. * ira.cc (ira): Gate add_store_equivs on flag_expensive_optimizations. Diff: --- gcc/ira.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ira.cc b/gcc/ira.cc index 156541df4e6c..9950ccac70bb 100644 --- a/gcc/ira.cc +++ b/gcc/ira.cc @@ -5738,7 +5738,7 @@ ira (FILE *f) combine_and_move_insns (); /* Gather additional equivalences with memory. */ - if (optimize) + if (optimize && flag_expensive_optimizations) add_store_equivs (); loop_optimizer_finalize ();