summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-19 22:09:04 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-19 22:09:04 +0000
commitaf6e428f8ce9fdcbda07ded6401a437efbdc0c18 (patch)
treeb3ae6e0b7dd8c5a72816817f086f03774a8e8919
parent83f6a58075cced8b3b5bd848de2366d4a4e2c018 (diff)
downloadppe42-gcc-af6e428f8ce9fdcbda07ded6401a437efbdc0c18.tar.gz
ppe42-gcc-af6e428f8ce9fdcbda07ded6401a437efbdc0c18.zip
* config/ia64/ia64.c (ia64_single_set): Return first set for
prologue_allocate_stack and epilogue_deallocate_stack instructions. * gcc.c-torture/compile/20011219-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48187 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/ia64/ia64.c19
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20011219-1.c29
4 files changed, 55 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e5aa14daed1..148beccf8bc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2001-12-19 Jakub Jelinek <jakub@redhat.com>
+
+ * config/ia64/ia64.c (ia64_single_set): Return first set for
+ prologue_allocate_stack and epilogue_deallocate_stack instructions.
+
2001-12-19 Dale Johannesen <dalej@apple.com>
* config/rs6000/rs6000.h: LEGITIMIZE_RELOAD_ADDRESS:
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index c46fe1262ca..133a2678485 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -5226,12 +5226,27 @@ static rtx
ia64_single_set (insn)
rtx insn;
{
- rtx x = PATTERN (insn);
+ rtx x = PATTERN (insn), ret;
if (GET_CODE (x) == COND_EXEC)
x = COND_EXEC_CODE (x);
if (GET_CODE (x) == SET)
return x;
- return single_set_2 (insn, x);
+ ret = single_set_2 (insn, x);
+ if (ret == NULL && GET_CODE (x) == PARALLEL)
+ {
+ /* Special case here prologue_allocate_stack and
+ epilogue_deallocate_stack. Although it is not a classical
+ single set, the second set is there just to protect it
+ from moving past FP-relative stack accesses. */
+ if (XVECLEN (x, 0) == 2
+ && GET_CODE (XVECEXP (x, 0, 0)) == SET
+ && GET_CODE (XVECEXP (x, 0, 1)) == SET
+ && GET_CODE (SET_DEST (XVECEXP (x, 0, 1))) == REG
+ && SET_DEST (XVECEXP (x, 0, 1)) == SET_SRC (XVECEXP (x, 0, 1))
+ && ia64_safe_itanium_class (insn) == ITANIUM_CLASS_IALU)
+ ret = XVECEXP (x, 0, 0);
+ }
+ return ret;
}
/* Adjust the cost of a scheduling dependency. Return the new cost of
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b198da8b3d5..dedaaef2d50 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2001-12-19 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/compile/20011219-1.c: New test.
+
2001-12-19 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/other/error1.C: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/20011219-1.c b/gcc/testsuite/gcc.c-torture/compile/20011219-1.c
new file mode 100644
index 00000000000..04923092dff
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20011219-1.c
@@ -0,0 +1,29 @@
+/* This testcase failed on IA-64 at -O2 during scheduling. */
+
+void * baz (unsigned long);
+static inline double **
+bar (long w, long x, long y, long z)
+{
+ long i, a = x - w + 1, b = z - y + 1;
+ double **m = (double **) baz (sizeof (double *) * (a + 1));
+
+ m += 1;
+ m -= w;
+ m[w] = (double *) baz (sizeof (double) * (a * b + 1));
+ m[w] += 1;
+ m[w] -= y;
+ for (i = w + 1; i <= x; i++)
+ m[i] = m[i - 1] + b;
+ return m;
+}
+
+void
+foo (double w[], int x, double y[], double z[])
+{
+ int i;
+ double **a;
+
+ a = bar (1, 50, 1, 50);
+ for (i = 1; i <= x; i++)
+ a[1][i] = - w[x - i] / w[x];
+}
OpenPOWER on IntegriCloud