public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-5581] PR target/108589 - Check REG_P for AARCH64_FUSE_ADDSUB_2REG_CONST1
@ 2023-01-31 15:34 Philipp Tomsich
  0 siblings, 0 replies; only message in thread
From: Philipp Tomsich @ 2023-01-31 15:34 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a39c6ec97906766ad65d15d4856fd41121ee7a45

commit r13-5581-ga39c6ec97906766ad65d15d4856fd41121ee7a45
Author: Philipp Tomsich <philipp.tomsich@vrull.eu>
Date:   Mon Jan 30 23:40:26 2023 +0100

    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.

Diff:
---
 gcc/config/aarch64/aarch64.cc               |  1 +
 gcc/testsuite/gcc.target/aarch64/pr108589.c | 15 +++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index 17c1e23e5b5..acc0cfe5f94 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 00000000000..861727f7268
--- /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);
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-31 15:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-31 15:34 [gcc r13-5581] PR target/108589 - Check REG_P for AARCH64_FUSE_ADDSUB_2REG_CONST1 Philipp Tomsich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).