summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-04 14:08:16 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-04 14:08:16 +0000
commit72ab6a85a7a4d64087253e8dc69a41db8d390fb9 (patch)
tree2554d10152e693ead3b4c6250f3de30e1bc5c022
parented86421ac990a1fa36e56e257094c29f6a72619d (diff)
downloadppe42-gcc-72ab6a85a7a4d64087253e8dc69a41db8d390fb9.tar.gz
ppe42-gcc-72ab6a85a7a4d64087253e8dc69a41db8d390fb9.zip
PR target/15342
* regrename.c (scan_rtx): Treat the destinations of SETs and CLOBBERs as OP_INOUT if the instruction is predicated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90063 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/regrename.c6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/20041104-1.c18
4 files changed, 33 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 033e47b2f4b..0320b0c8726 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/regrename.c b/gcc/regrename.c
index dc2bb01780e..3856c2cf020 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -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:
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 770171aac03..2e1d71da6e5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 00000000000..b4d359d1e7b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20041104-1.c
@@ -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;
+ }
+}
OpenPOWER on IntegriCloud