ia64.c (group_barrier_needed_p): Special case prologue_allocate_stack.

* 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
This commit is contained in:
Richard Henderson 2002-03-30 16:15:19 -08:00 committed by Richard Henderson
parent 4ab95d8267
commit bdbe5b8d8d
4 changed files with 52 additions and 14 deletions

View 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.

View 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 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))
{
/* 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);
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;
}

View File

@ -4848,7 +4848,7 @@
[(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))]
""
"@

View File

@ -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);
}