re PR target/27158 (ICE in extract_insn with -maltivec)

PR target/27158
	* reload.c (find_reloads_toplev): Only return the simplified SUBREG
	of a reg_equiv_constant if the result is a legitimate constant.

	* gcc.target/powerpc/pr27158.c: New test case.

From-SVN: r113632
This commit is contained in:
Roger Sayle 2006-05-08 21:09:49 +00:00 committed by Roger Sayle
parent 13637c491f
commit 857e575351
4 changed files with 42 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2006-05-08 Roger Sayle <roger@eyesopen.com>
PR target/27158
* reload.c (find_reloads_toplev): Only return the simplified SUBREG
of a reg_equiv_constant if the result is a legitimate constant.
2006-05-08 Uros Bizjak <uros@kss-loka.si>
PR target/27277

View File

@ -4559,20 +4559,24 @@ find_reloads_toplev (rtx x, int opnum, enum reload_type type,
rtx tem;
if (subreg_lowpart_p (x)
&& regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] < 0
&& regno >= FIRST_PSEUDO_REGISTER
&& reg_renumber[regno] < 0
&& reg_equiv_constant[regno] != 0
&& (tem = gen_lowpart_common (GET_MODE (x),
reg_equiv_constant[regno])) != 0)
reg_equiv_constant[regno])) != 0
&& LEGITIMATE_CONSTANT_P (tem))
return tem;
if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] < 0
if (regno >= FIRST_PSEUDO_REGISTER
&& reg_renumber[regno] < 0
&& reg_equiv_constant[regno] != 0)
{
tem =
simplify_gen_subreg (GET_MODE (x), reg_equiv_constant[regno],
GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x));
gcc_assert (tem);
return tem;
if (LEGITIMATE_CONSTANT_P (tem))
return tem;
}
/* If the subreg contains a reg that will be converted to a mem,
@ -4588,7 +4592,7 @@ find_reloads_toplev (rtx x, int opnum, enum reload_type type,
a wider mode if we have a paradoxical SUBREG. find_reloads will
force a reload in that case. So we should not do anything here. */
else if (regno >= FIRST_PSEUDO_REGISTER
if (regno >= FIRST_PSEUDO_REGISTER
#ifdef LOAD_EXTEND_OP
&& (GET_MODE_SIZE (GET_MODE (x))
<= GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))

View File

@ -1,3 +1,8 @@
2006-05-08 Roger Sayle <roger@eyesopen.com>
PR target/27158
* gcc.target/powerpc/pr27158.c: New test case.
2006-05-08 Laurent GUERBY <laurent@guerby.net>
PR testsuite/27476

View File

@ -0,0 +1,22 @@
/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-xfail-if "" { "powerpc-*-eabispe*" "powerpc-ibm-aix*" } { "*" } { "" } } */
/* { dg-options "-O2 -maltivec" } */
#define REGLIST \
"77", "78", "79", "80", "81", "82", "83", "84", "85", "86",\
"87", "88", "89", "90", "91", "92", "93", "94", "95", "96",\
"97", "98", "99", "100", "101", "102", "103", "104", "105", "106",\
"107", "108"
typedef __attribute__ ((vector_size (16))) float v4sf;
void
foo (int H)
{
volatile v4sf tmp;
while (H-- > 0)
{
asm ("" : : : REGLIST);
tmp = (v4sf) __builtin_altivec_vspltisw (1);
}
}