aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authorPat Haugen <pthaugen@us.ibm.com>2007-09-06 13:51:21 +0000
committerPat Haugen <pthaugen@gcc.gnu.org>2007-09-06 13:51:21 +0000
commitbd379f7328b2ff3b17f5845dbe49796f97a79c25 (patch)
tree620790cc14778ca43ae1261ccbee1a3cae2f9cfd /gcc/reload.c
parent200809cbbf0d8e99ce059e82494b8bd3a5c16ca9 (diff)
downloadgcc-bd379f7328b2ff3b17f5845dbe49796f97a79c25.zip
gcc-bd379f7328b2ff3b17f5845dbe49796f97a79c25.tar.gz
gcc-bd379f7328b2ff3b17f5845dbe49796f97a79c25.tar.bz2
reload.c (find_reloads_address_1): Try to preserve original base/index regclass of operands.
ChangeLog: 2007-09-06 Pat Haugen <pthaugen@us.ibm.com> * reload.c (find_reloads_address_1): Try to preserve original base/index regclass of operands. * regrename.c (scan_rtx_address): Likewise. (replace_oldest_value_addr): Likewise. From-SVN: r128183
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index 60e36ffc..6eb3802 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -5464,16 +5464,12 @@ find_reloads_address_1 (enum machine_mode mode, rtx x, int context,
else if (code0 == REG && code1 == REG)
{
- if (REGNO_OK_FOR_INDEX_P (REGNO (op0))
- && regno_ok_for_base_p (REGNO (op1), mode, PLUS, REG))
+ if (REGNO_OK_FOR_INDEX_P (REGNO (op1))
+ && regno_ok_for_base_p (REGNO (op0), mode, PLUS, REG))
return 0;
- else if (REGNO_OK_FOR_INDEX_P (REGNO (op1))
- && regno_ok_for_base_p (REGNO (op0), mode, PLUS, REG))
+ else if (REGNO_OK_FOR_INDEX_P (REGNO (op0))
+ && regno_ok_for_base_p (REGNO (op1), mode, PLUS, REG))
return 0;
- else if (regno_ok_for_base_p (REGNO (op1), mode, PLUS, REG))
- find_reloads_address_1 (mode, orig_op0, 1, PLUS, SCRATCH,
- &XEXP (x, 0), opnum, type, ind_levels,
- insn);
else if (regno_ok_for_base_p (REGNO (op0), mode, PLUS, REG))
find_reloads_address_1 (mode, orig_op1, 1, PLUS, SCRATCH,
&XEXP (x, 1), opnum, type, ind_levels,
@@ -5482,16 +5478,20 @@ find_reloads_address_1 (enum machine_mode mode, rtx x, int context,
find_reloads_address_1 (mode, orig_op0, 0, PLUS, REG,
&XEXP (x, 0), opnum, type, ind_levels,
insn);
+ else if (regno_ok_for_base_p (REGNO (op1), mode, PLUS, REG))
+ find_reloads_address_1 (mode, orig_op0, 1, PLUS, SCRATCH,
+ &XEXP (x, 0), opnum, type, ind_levels,
+ insn);
else if (REGNO_OK_FOR_INDEX_P (REGNO (op0)))
find_reloads_address_1 (mode, orig_op1, 0, PLUS, REG,
&XEXP (x, 1), opnum, type, ind_levels,
insn);
else
{
- find_reloads_address_1 (mode, orig_op0, 1, PLUS, SCRATCH,
+ find_reloads_address_1 (mode, orig_op0, 0, PLUS, REG,
&XEXP (x, 0), opnum, type, ind_levels,
insn);
- find_reloads_address_1 (mode, orig_op1, 0, PLUS, REG,
+ find_reloads_address_1 (mode, orig_op1, 1, PLUS, SCRATCH,
&XEXP (x, 1), opnum, type, ind_levels,
insn);
}