]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/15342 ([arm-linux] internal compiler error: in verify_local_li...
authorRichard Sandiford <rsandifo@redhat.com>
Thu, 4 Nov 2004 14:08:16 +0000 (14:08 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 4 Nov 2004 14:08:16 +0000 (14:08 +0000)
PR target/15342
* regrename.c (scan_rtx): Treat the destinations of SETs and CLOBBERs
as OP_INOUT if the instruction is predicated.

From-SVN: r90063

gcc/ChangeLog
gcc/regrename.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20041104-1.c [new file with mode: 0644]

index 033e47b2f4b91dcf605efa09a52915c5cbbedba4..0320b0c87263e0520aaa9f403ecdd4494803599d 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-04  Richard Sandiford  <rsandifo@redhat.com>
+
+       PR target/15342
+       * regrename.c (scan_rtx): Treat the destinations of SETs and CLOBBERs
+       as OP_INOUT if the instruction is predicated.
+
 2004-11-04  Kazu Hirata  <kazu@cs.umass.edu>
 
        * bitmap.h: Fix a comment typo.  Follow spelling conventions.
index dc2bb01780ed9bc4400791b11c74989ef5efd299..3856c2cf0208bb8732aa835c0788553c5d85570c 100644 (file)
@@ -667,7 +667,8 @@ scan_rtx (rtx insn, rtx *loc, enum reg_class cl,
 
     case SET:
       scan_rtx (insn, &SET_SRC (x), cl, action, OP_IN, 0);
-      scan_rtx (insn, &SET_DEST (x), cl, action, OP_OUT, 0);
+      scan_rtx (insn, &SET_DEST (x), cl, action,
+               GET_CODE (PATTERN (insn)) == COND_EXEC ? OP_INOUT : OP_OUT, 0);
       return;
 
     case STRICT_LOW_PART:
@@ -692,7 +693,8 @@ scan_rtx (rtx insn, rtx *loc, enum reg_class cl,
       gcc_unreachable ();
 
     case CLOBBER:
-      scan_rtx (insn, &SET_DEST (x), cl, action, OP_OUT, 1);
+      scan_rtx (insn, &SET_DEST (x), cl, action,
+               GET_CODE (PATTERN (insn)) == COND_EXEC ? OP_INOUT : OP_OUT, 0);
       return;
 
     case EXPR_LIST:
index 770171aac035dab3bdb357f6d1e9b43ba147c3e8..2e1d71da6e567294ce56ca6f3ed47d462358052d 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-04  Richard Sandiford  <rsandifo@redhat.com>
+
+       PR target/15342
+       * gcc.dg/20041104-1.c: New test.
+
 2004-11-04  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
 
        * g++.dg/template/nontype7.C: New test.
diff --git a/gcc/testsuite/gcc.dg/20041104-1.c b/gcc/testsuite/gcc.dg/20041104-1.c
new file mode 100644 (file)
index 0000000..b4d359d
--- /dev/null
@@ -0,0 +1,18 @@
+/* This testcase exposed the same bug as PR 15342.  */
+/* { dg-options "-O2 -frename-registers -fno-schedule-insns" } */
+
+void *memcpy (void *, const void *, __SIZE_TYPE__);
+
+void f (int n, int (*x)[4])
+{
+  while (n--)
+    {
+      int f = x[0][0];
+      if (f <= 0)
+       memcpy (&x[1], &x[0], sizeof (x[0]));
+      else
+       memcpy (&x[f], &x[0], sizeof (x[0]));
+      f = x[0][2];
+      x[0][1] = f;
+    }
+}