]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
dep_fusion: Fix if target does not have macro fusion [PR121835]
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Sat, 6 Sep 2025 22:24:00 +0000 (15:24 -0700)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Sat, 6 Sep 2025 22:29:16 +0000 (15:29 -0700)
This new pass will ICE if the target does not define the macro_fusion_pair_p
pass. The pass will not be useful in that case so it is best to return
early.

Pushed as obvious after a bootstrap on x86_64-linux-gnu.

PR rtl-optimization/121835
gcc/ChangeLog:

* dep-fusion.cc (pass_dep_fusion::execute): Return early if
macro_fusion_pair_p is null.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
gcc/dep-fusion.cc

index 1e69e68dd8762509baac5af412faee3980ed9624..d040af6991ef1a6500e2210d32c2ea6d864798b5 100644 (file)
@@ -75,6 +75,10 @@ pass_dep_fusion::gate (function *)
 unsigned int
 pass_dep_fusion::execute (function *fn)
 {
+  // If the target has no macro fusion, there is nothing to be done.
+  if (!targetm.sched.macro_fusion_pair_p)
+    return 0;
+
   // Initialization.
   calculate_dominance_info (CDI_DOMINATORS);
   df_analyze ();