aboutsummaryrefslogtreecommitdiff
path: root/gcc/regrename.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/regrename.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/regrename.c')
-rw-r--r--gcc/regrename.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/gcc/regrename.c b/gcc/regrename.c
index a15d675..74112c3 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -559,20 +559,19 @@ scan_rtx_address (rtx insn, rtx *loc, enum reg_class cl,
int index_op;
unsigned regno0 = REGNO (op0), regno1 = REGNO (op1);
- if (REGNO_OK_FOR_INDEX_P (regno0)
- && regno_ok_for_base_p (regno1, mode, PLUS, REG))
+ if (REGNO_OK_FOR_INDEX_P (regno1)
+ && regno_ok_for_base_p (regno0, mode, PLUS, REG))
+ index_op = 1;
+ else if (REGNO_OK_FOR_INDEX_P (regno0)
+ && regno_ok_for_base_p (regno1, mode, PLUS, REG))
index_op = 0;
- else if (REGNO_OK_FOR_INDEX_P (regno1)
- && regno_ok_for_base_p (regno0, mode, PLUS, REG))
+ else if (regno_ok_for_base_p (regno0, mode, PLUS, REG)
+ || REGNO_OK_FOR_INDEX_P (regno1))
index_op = 1;
else if (regno_ok_for_base_p (regno1, mode, PLUS, REG))
index_op = 0;
- else if (regno_ok_for_base_p (regno0, mode, PLUS, REG))
- index_op = 1;
- else if (REGNO_OK_FOR_INDEX_P (regno1))
- index_op = 1;
else
- index_op = 0;
+ index_op = 1;
locI = &XEXP (x, index_op);
locB = &XEXP (x, !index_op);
@@ -1476,20 +1475,19 @@ replace_oldest_value_addr (rtx *loc, enum reg_class cl,
int index_op;
unsigned regno0 = REGNO (op0), regno1 = REGNO (op1);
- if (REGNO_OK_FOR_INDEX_P (regno0)
- && regno_ok_for_base_p (regno1, mode, PLUS, REG))
+ if (REGNO_OK_FOR_INDEX_P (regno1)
+ && regno_ok_for_base_p (regno0, mode, PLUS, REG))
+ index_op = 1;
+ else if (REGNO_OK_FOR_INDEX_P (regno0)
+ && regno_ok_for_base_p (regno1, mode, PLUS, REG))
index_op = 0;
- else if (REGNO_OK_FOR_INDEX_P (regno1)
- && regno_ok_for_base_p (regno0, mode, PLUS, REG))
+ else if (regno_ok_for_base_p (regno0, mode, PLUS, REG)
+ || REGNO_OK_FOR_INDEX_P (regno1))
index_op = 1;
else if (regno_ok_for_base_p (regno1, mode, PLUS, REG))
index_op = 0;
- else if (regno_ok_for_base_p (regno0, mode, PLUS, REG))
- index_op = 1;
- else if (REGNO_OK_FOR_INDEX_P (regno1))
- index_op = 1;
else
- index_op = 0;
+ index_op = 1;
locI = &XEXP (x, index_op);
locB = &XEXP (x, !index_op);