aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-05-07 10:14:19 +0200
committerRichard Biener <rguenther@suse.de>2024-05-07 10:15:20 +0200
commit9dbff9c05520a74e6cd337578f27b56c941f64f3 (patch)
tree91760840adbc10b5d0ddfe75c1b02d54e3f204cb
parentcb478e0a6f3a296e1c234a85fc0d45d633a0ff93 (diff)
downloadgcc-9dbff9c05520a74e6cd337578f27b56c941f64f3.zip
gcc-9dbff9c05520a74e6cd337578f27b56c941f64f3.tar.gz
gcc-9dbff9c05520a74e6cd337578f27b56c941f64f3.tar.bz2
Revert "Revert "combine: Don't combine if I2 does not change""
This reverts commit 109f1b28fc94c93096506e3df0c25e331cef19d0.
-rw-r--r--gcc/combine.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/combine.cc b/gcc/combine.cc
index 92b8d98..71c9abc 100644
--- a/gcc/combine.cc
+++ b/gcc/combine.cc
@@ -4196,6 +4196,17 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
adjust_for_new_dest (i3);
}
+ /* If I2 didn't change, this is not a combination (but a simplification or
+ canonicalisation with context), which should not be done here. Doing
+ it here explodes the algorithm. Don't. */
+ if (rtx_equal_p (newi2pat, PATTERN (i2)))
+ {
+ if (dump_file)
+ fprintf (dump_file, "i2 didn't change, not doing this\n");
+ undo_all ();
+ return 0;
+ }
+
/* We now know that we can do this combination. Merge the insns and
update the status of registers and LOG_LINKS. */