+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.
/* 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;
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;
}
[(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))]
""
"@
--- /dev/null
+/* 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);
+}