public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] [PR103028] test ifcvt trap_if seq more strictly after reload
@ 2021-12-03  6:17 Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2021-12-03  6:17 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:1041e986a33778474e03a088815ec4f5a0847204

commit 1041e986a33778474e03a088815ec4f5a0847204
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Fri Dec 3 02:14:28 2021 -0300

    [PR103028] test ifcvt trap_if seq more strictly after reload

Diff:
---
 gcc/ifcvt.c                     |  4 +++-
 gcc/testsuite/gcc.dg/pr103028.c | 21 +++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 017944f4f79..b0052f6c5ce 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -4726,7 +4726,9 @@ find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge)
 
   /* If that results in an invalid insn, back out.  */
   for (rtx_insn *x = seq; x; x = NEXT_INSN (x))
-    if (recog_memoized (x) < 0)
+    if (reload_completed
+	? !valid_insn_p (x)
+	: recog_memoized (x) < 0)
       return FALSE;
 
   /* Emit the new insns before cond_earliest.  */
diff --git a/gcc/testsuite/gcc.dg/pr103028.c b/gcc/testsuite/gcc.dg/pr103028.c
new file mode 100644
index 00000000000..df96c62ddd3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr103028.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fif-conversion2 -Og" } */
+/* { dg-options "-fif-conversion2 -Og -march=z9-ec" { target { s390x-*-* } } } */
+
+unsigned char x;
+int foo(void)
+{
+  unsigned long long i = x;
+  i = i + 0x80000000;
+  unsigned long long t = 0xffffffff;
+
+  if (i > t) {
+    unsigned long long ii;
+    asm("":"=g"(ii):"0"(i));
+    if ((ii <= t))
+      __builtin_trap();
+    return x;
+  }
+
+ return 0;
+}


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] [PR103028] test ifcvt trap_if seq more strictly after reload
@ 2021-12-03  5:31 Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2021-12-03  5:31 UTC (permalink / raw)
  To: gcc-cvs

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

commit dd1675ee9fb39922e7cb2dd4aea67875e37d0b81
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Fri Dec 3 02:14:28 2021 -0300

    [PR103028] test ifcvt trap_if seq more strictly after reload

Diff:
---
 gcc/ifcvt.c                     |  4 +++-
 gcc/testsuite/gcc.dg/pr103028.c | 21 +++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 017944f4f79..b0052f6c5ce 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -4726,7 +4726,9 @@ find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge)
 
   /* If that results in an invalid insn, back out.  */
   for (rtx_insn *x = seq; x; x = NEXT_INSN (x))
-    if (recog_memoized (x) < 0)
+    if (reload_completed
+	? !valid_insn_p (x)
+	: recog_memoized (x) < 0)
       return FALSE;
 
   /* Emit the new insns before cond_earliest.  */
diff --git a/gcc/testsuite/gcc.dg/pr103028.c b/gcc/testsuite/gcc.dg/pr103028.c
new file mode 100644
index 00000000000..df96c62ddd3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr103028.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fif-conversion2 -Og" } */
+/* { dg-options "-fif-conversion2 -Og -march=z9-ec" { target { s390x-*-* } } } */
+
+unsigned char x;
+int foo(void)
+{
+  unsigned long long i = x;
+  i = i + 0x80000000;
+  unsigned long long t = 0xffffffff;
+
+  if (i > t) {
+    unsigned long long ii;
+    asm("":"=g"(ii):"0"(i));
+    if ((ii <= t))
+      __builtin_trap();
+    return x;
+  }
+
+ return 0;
+}


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-03  6:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03  6:17 [gcc(refs/users/aoliva/heads/testme)] [PR103028] test ifcvt trap_if seq more strictly after reload Alexandre Oliva
  -- strict thread matches above, loose matches on Subject: below --
2021-12-03  5:31 Alexandre Oliva

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).