aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPhilipp Tomsich <philipp.tomsich@vrull.eu>2023-01-30 23:40:26 +0100
committerPhilipp Tomsich <philipp.tomsich@vrull.eu>2023-01-31 16:34:28 +0100
commita39c6ec97906766ad65d15d4856fd41121ee7a45 (patch)
tree613f4fcd13cba4b54eeefcb7a6e4da31099ca19c /gcc
parent2bb444787ed17a9e786f544cdf51ee2ac6779ab2 (diff)
downloadgcc-a39c6ec97906766ad65d15d4856fd41121ee7a45.zip
gcc-a39c6ec97906766ad65d15d4856fd41121ee7a45.tar.gz
gcc-a39c6ec97906766ad65d15d4856fd41121ee7a45.tar.bz2
PR target/108589 - Check REG_P for AARCH64_FUSE_ADDSUB_2REG_CONST1
This adds a check for REG_P on SET_DEST for the new idiom recognizer for AARCH64_FUSE_ADDSUB_2REG_CONST1. The reported ICE is only observable with checking=rtl. Bootstrapped/regtested aarch64-linux, committed. PR target/108589 gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch_macro_fusion_pair_p): Check REG_P on SET_DEST. gcc/testsuite/ChangeLog: * gcc.target/aarch64/pr108589.c: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/aarch64/aarch64.cc1
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr108589.c15
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index 17c1e23..acc0cfe 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -25704,6 +25704,7 @@ aarch_macro_fusion_pair_p (rtx_insn *prev, rtx_insn *curr)
&& CONST_INT_P (XEXP (curr_src, 1))
&& INTVAL (XEXP (curr_src, 1)) == polarity
&& REG_P (XEXP (curr_src, 0))
+ && REG_P (SET_DEST (prev_set))
&& REGNO (SET_DEST (prev_set)) == REGNO (XEXP (curr_src, 0)))
return true;
}
diff --git a/gcc/testsuite/gcc.target/aarch64/pr108589.c b/gcc/testsuite/gcc.target/aarch64/pr108589.c
new file mode 100644
index 0000000..861727f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr108589.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-options "-Os -O2 -mtune=ampere1a -fno-split-wide-types" } */
+
+int i;
+__int128 j;
+short s;
+
+void
+foo (void)
+{
+ j -= i;
+ int l = i - __builtin_sub_overflow_p (0, 61680, s);
+ j -= __builtin_mul_overflow_p (i, l, 0);
+}