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.
(cherry picked from commit
a39c6ec97906766ad65d15d4856fd41121ee7a45)
&& 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;
}
--- /dev/null
+/* { 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);
+}