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.

Bootstrap and regtest running on x86_64-unknown-linux-gnu.

OK?

Thanks,
Richard.

        * ira.cc (ira): Gate add_store_equivs on flag_expensive_optimizations.
---
 gcc/ira.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/ira.cc b/gcc/ira.cc
index 3936456c4ed..5231f63398e 100644
--- a/gcc/ira.cc
+++ b/gcc/ira.cc
@@ -5739,7 +5739,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 ();
-- 
2.43.0

Reply via email to