aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1993-09-01 15:07:57 -0700
committerJim Wilson <wilson@gcc.gnu.org>1993-09-01 15:07:57 -0700
commit87935f601efe35aa8fbefbd4cb53c92864148b14 (patch)
treef2015339df02ca5cc8ca4fe4c6faac6fb2fbb425
parent5555d6d103826d686f2f4658f028009db877bdd2 (diff)
downloadgcc-87935f601efe35aa8fbefbd4cb53c92864148b14.zip
gcc-87935f601efe35aa8fbefbd4cb53c92864148b14.tar.gz
gcc-87935f601efe35aa8fbefbd4cb53c92864148b14.tar.bz2
(find_reloads_address_1): Handle SUBREGs same as REGs.
From-SVN: r5240
-rw-r--r--gcc/reload.c54
1 files changed, 34 insertions, 20 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index f3e8802..37d0efc 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -4379,30 +4379,44 @@ find_reloads_address_1 (x, context, loc, opnum, type, ind_levels)
if (code == PLUS)
{
- register rtx op0 = XEXP (x, 0);
- register rtx op1 = XEXP (x, 1);
- register RTX_CODE code0 = GET_CODE (op0);
- register RTX_CODE code1 = GET_CODE (op1);
+ register rtx orig_op0 = XEXP (x, 0);
+ register rtx orig_op1 = XEXP (x, 1);
+ register RTX_CODE code0 = GET_CODE (orig_op0);
+ register RTX_CODE code1 = GET_CODE (orig_op1);
+ register rtx op0 = orig_op0;
+ register rtx op1 = orig_op1;
+
+ if (GET_CODE (op0) == SUBREG)
+ {
+ op0 = SUBREG_REG (op0);
+ code0 = GET_CODE (op0);
+ }
+ if (GET_CODE (op1) == SUBREG)
+ {
+ op1 = SUBREG_REG (op1);
+ code1 = GET_CODE (op1);
+ }
+
if (code0 == MULT || code0 == SIGN_EXTEND || code1 == MEM)
{
- find_reloads_address_1 (op0, 1, &XEXP (x, 0), opnum, type,
+ find_reloads_address_1 (orig_op0, 1, &XEXP (x, 0), opnum, type,
ind_levels);
- find_reloads_address_1 (op1, 0, &XEXP (x, 1), opnum, type,
+ find_reloads_address_1 (orig_op1, 0, &XEXP (x, 1), opnum, type,
ind_levels);
}
else if (code1 == MULT || code1 == SIGN_EXTEND || code0 == MEM)
{
- find_reloads_address_1 (op0, 0, &XEXP (x, 0), opnum, type,
+ find_reloads_address_1 (orig_op0, 0, &XEXP (x, 0), opnum, type,
ind_levels);
- find_reloads_address_1 (op1, 1, &XEXP (x, 1), opnum, type,
+ find_reloads_address_1 (orig_op1, 1, &XEXP (x, 1), opnum, type,
ind_levels);
}
else if (code0 == CONST_INT || code0 == CONST
|| code0 == SYMBOL_REF || code0 == LABEL_REF)
- find_reloads_address_1 (op1, 0, &XEXP (x, 1), opnum, type, ind_levels);
+ find_reloads_address_1 (orig_op1, 0, &XEXP (x, 1), opnum, type, ind_levels);
else if (code1 == CONST_INT || code1 == CONST
|| code1 == SYMBOL_REF || code1 == LABEL_REF)
- find_reloads_address_1 (op0, 0, &XEXP (x, 0), opnum, type, ind_levels);
+ find_reloads_address_1 (orig_op0, 0, &XEXP (x, 0), opnum, type, ind_levels);
else if (code0 == REG && code1 == REG)
{
if (REG_OK_FOR_INDEX_P (op0)
@@ -4412,37 +4426,37 @@ find_reloads_address_1 (x, context, loc, opnum, type, ind_levels)
&& REG_OK_FOR_BASE_P (op0))
return 0;
else if (REG_OK_FOR_BASE_P (op1))
- find_reloads_address_1 (op0, 1, &XEXP (x, 0), opnum, type,
+ find_reloads_address_1 (orig_op0, 1, &XEXP (x, 0), opnum, type,
ind_levels);
else if (REG_OK_FOR_BASE_P (op0))
- find_reloads_address_1 (op1, 1, &XEXP (x, 1), opnum, type,
+ find_reloads_address_1 (orig_op1, 1, &XEXP (x, 1), opnum, type,
ind_levels);
else if (REG_OK_FOR_INDEX_P (op1))
- find_reloads_address_1 (op0, 0, &XEXP (x, 0), opnum, type,
+ find_reloads_address_1 (orig_op0, 0, &XEXP (x, 0), opnum, type,
ind_levels);
else if (REG_OK_FOR_INDEX_P (op0))
- find_reloads_address_1 (op1, 0, &XEXP (x, 1), opnum, type,
+ find_reloads_address_1 (orig_op1, 0, &XEXP (x, 1), opnum, type,
ind_levels);
else
{
- find_reloads_address_1 (op0, 1, &XEXP (x, 0), opnum, type,
+ find_reloads_address_1 (orig_op0, 1, &XEXP (x, 0), opnum, type,
ind_levels);
- find_reloads_address_1 (op1, 0, &XEXP (x, 1), opnum, type,
+ find_reloads_address_1 (orig_op1, 0, &XEXP (x, 1), opnum, type,
ind_levels);
}
}
else if (code0 == REG)
{
- find_reloads_address_1 (op0, 1, &XEXP (x, 0), opnum, type,
+ find_reloads_address_1 (orig_op0, 1, &XEXP (x, 0), opnum, type,
ind_levels);
- find_reloads_address_1 (op1, 0, &XEXP (x, 1), opnum, type,
+ find_reloads_address_1 (orig_op1, 0, &XEXP (x, 1), opnum, type,
ind_levels);
}
else if (code1 == REG)
{
- find_reloads_address_1 (op1, 1, &XEXP (x, 1), opnum, type,
+ find_reloads_address_1 (orig_op1, 1, &XEXP (x, 1), opnum, type,
ind_levels);
- find_reloads_address_1 (op0, 0, &XEXP (x, 0), opnum, type,
+ find_reloads_address_1 (orig_op0, 0, &XEXP (x, 0), opnum, type,
ind_levels);
}
}