aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2024-06-27 14:51:37 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2024-06-27 14:51:37 +0100
commitf6081ee665fd5e4e7d37e02c69d16df0d3eead10 (patch)
treeaa4fda973fcd469b20d9148af4a3234de5ca0276
parent187eeb99ec5289538923668de9d61a3138376817 (diff)
downloadgcc-f6081ee665fd5e4e7d37e02c69d16df0d3eead10.zip
gcc-f6081ee665fd5e4e7d37e02c69d16df0d3eead10.tar.gz
gcc-f6081ee665fd5e4e7d37e02c69d16df0d3eead10.tar.bz2
Disable late-combine for -O0 [PR115677]
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. gcc/ PR rtl-optimization/115677 * late-combine.cc (pass_late_combine::gate): New function.
-rw-r--r--gcc/late-combine.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/late-combine.cc b/gcc/late-combine.cc
index b7c0bc0..789d734 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)
{