]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ia64.c (group_barrier_needed_p): Special case prologue_allocate_stack.
authorRichard Henderson <rth@redhat.com>
Sun, 31 Mar 2002 00:15:19 +0000 (16:15 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Sun, 31 Mar 2002 00:15:19 +0000 (16:15 -0800)
        * config/ia64/ia64.c (group_barrier_needed_p): Special case
        prologue_allocate_stack.
        (ia64_single_set): Use insn codes for recognition of special
        cases, not rtl matching.
        * config/ia64/ia64.md (prologue_allocate_stack): Op 3 is in-out.

* gcc.c-torture/compile/20020330-1.c: New.

From-SVN: r51615

gcc/ChangeLog
gcc/config/ia64/ia64.c
gcc/config/ia64/ia64.md
gcc/testsuite/gcc.c-torture/compile/20020330-1.c [new file with mode: 0644]

index 2a9cee9a7eea15ce6b27cb64e2e968bb1055a276..21c516c59ddf86b07c549b40f72712b109b6b4af 100644 (file)
@@ -1,3 +1,12 @@
+2002-03-30  Richard Henderson  <rth@redhat.com>
+
+       PR target/5446
+       * config/ia64/ia64.c (group_barrier_needed_p): Special case
+       prologue_allocate_stack.
+       (ia64_single_set): Use insn codes for recognition of special
+       cases, not rtl matching.
+       * config/ia64/ia64.md (prologue_allocate_stack): Op 3 is in-out.
+
 Sat Mar 30 23:48:41 CET 2002  Jan Hubicka  <jh@suse.cz>
 
        * cfgbuild.c (find_basic_blocks_1): Clear aux for blocks.
index 78ba70e1e85175319957c7490f96a5d7880d4ee9..74cbf813ca40057c94d678cbe2c6e72cc3b2d8ef 100644 (file)
@@ -4764,6 +4764,7 @@ group_barrier_needed_p (insn)
          /* We play dependency tricks with the epilogue in order
             to get proper schedules.  Undo this for dv analysis.  */
        case CODE_FOR_epilogue_deallocate_stack:
+       case CODE_FOR_prologue_allocate_stack:
          pat = XVECEXP (pat, 0, 0);
          break;
 
@@ -5235,21 +5236,22 @@ ia64_single_set (insn)
     x = COND_EXEC_CODE (x);
   if (GET_CODE (x) == SET)
     return 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);
+
+  /* Special case here prologue_allocate_stack and epilogue_deallocate_stack.
+     Although they are not classical single set, the second set is there just
+     to protect it from moving past FP-relative stack accesses.  */
+  switch (recog_memoized (insn))
+    {
+    case CODE_FOR_prologue_allocate_stack:
+    case CODE_FOR_epilogue_deallocate_stack:
+      ret = XVECEXP (x, 0, 0);
+      break;
+
+    default:
+      ret = single_set_2 (insn, x);
+      break;
     }
+
   return ret;
 }
 
index 8b134a6787423675e0f957c4253adb404d44cc2c..a7d7dcaab74de9b1e4f68935904bcf55cf38c37a 100644 (file)
   [(set (match_operand:DI 0 "register_operand" "=r,r,r")
        (plus:DI (match_operand:DI 1 "register_operand" "%r,r,a")
                 (match_operand:DI 2 "gr_reg_or_22bit_operand" "r,I,J")))
-   (set (match_operand:DI 3 "register_operand" "=r,r,r")
+   (set (match_operand:DI 3 "register_operand" "+r,r,r")
        (match_dup 3))]
   ""
   "@
diff --git a/gcc/testsuite/gcc.c-torture/compile/20020330-1.c b/gcc/testsuite/gcc.c-torture/compile/20020330-1.c
new file mode 100644 (file)
index 0000000..cac7099
--- /dev/null
@@ -0,0 +1,27 @@
+/* PR 5446 */
+/* This testcase is similar to gcc.c-torture/compile/20011219-1.c except
+   with parts of it omitted, causing an ICE with -O3 on IA-64.  */
+
+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));
+  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);
+}