diff mbox series

[pushed] Disable late-combine for -O0 [PR115677]

Message ID mpto77mebmb.fsf@arm.com
State New
Headers show
Series [pushed] Disable late-combine for -O0 [PR115677] | expand

Commit Message

Richard Sandiford June 27, 2024, 1:52 p.m. UTC
late-combine relies on df, which for -O0 is only initialised late
(pass_df_initialize_no_opt, after split1).  Other df-based passes
cope with this by requiring optimize > 0, so this patch does the
same for late-combine.

Bootstrapped & regression tested on aarch64-linux-gnu, pushed as obvious.

Richard


gcc/
	PR rtl-optimization/115677
	* late-combine.cc (pass_late_combine::gate): New function.
---
 gcc/late-combine.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/late-combine.cc b/gcc/late-combine.cc
index b7c0bc07a8b..789d734692a 100644
--- a/gcc/late-combine.cc
+++ b/gcc/late-combine.cc
@@ -744,10 +744,16 @@  public:
 
   // opt_pass methods:
   opt_pass *clone () override { return new pass_late_combine (m_ctxt); }
-  bool gate (function *) override { return flag_late_combine_instructions; }
+  bool gate (function *) override;
   unsigned int execute (function *) override;
 };
 
+bool
+pass_late_combine::gate (function *)
+{
+  return optimize > 0 && flag_late_combine_instructions;
+}
+
 unsigned int
 pass_late_combine::execute (function *fn)
 {