aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2006-05-08 21:09:49 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2006-05-08 21:09:49 +0000
commit857e57535196dbb690cf80afadbfda9756417a4b (patch)
treed279562bb2861a814d3e5dfb410f57178f971f5f /gcc/reload.c
parent13637c491f74ce8bb97d14d2fd6a7c935800e724 (diff)
downloadgcc-857e57535196dbb690cf80afadbfda9756417a4b.zip
gcc-857e57535196dbb690cf80afadbfda9756417a4b.tar.gz
gcc-857e57535196dbb690cf80afadbfda9756417a4b.tar.bz2
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
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index e7798b9..03b5ba6 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -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))))