summaryrefslogtreecommitdiff
path: root/gcc/regclass.c
diff options
context:
space:
mode:
authorChristian Iseli <Christian.Iseli@lslsun.epfl.ch>1997-10-17 17:46:57 +0200
committerJeff Law <law@gcc.gnu.org>1997-10-17 09:46:57 -0600
commitf22376c716a73cfb82b58c5f3c5889ba20fdbfc7 (patch)
tree61e23b048b828f49ad3bd66ac314adcfbd0768d3 /gcc/regclass.c
parentb8fb2d721d6299b18eced2ce5ef777a6196cb507 (diff)
downloadgcc-f22376c716a73cfb82b58c5f3c5889ba20fdbfc7.tar.gz
regclass.c (record_address_regs): Look at REG_OK_FOR_{BASE,INDEX}_P for hard regs to determine base and index...
* regclass.c (record_address_regs): Look at REG_OK_FOR_{BASE,INDEX}_P for hard regs to determine base and index registers. From-SVN: r15954
Diffstat (limited to 'gcc/regclass.c')
-rw-r--r--gcc/regclass.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/regclass.c b/gcc/regclass.c
index 2932db13810..45ee16ee202 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -1539,6 +1539,32 @@ record_address_regs (x, class, scale)
else if (code1 == SYMBOL_REF || code1 == CONST || code1 == LABEL_REF)
record_address_regs (arg0, INDEX_REG_CLASS, scale);
+ /* Look for the sum of two registers where the first is definitely
+ a base register or the second is definitely an index register. */
+
+ else if (code0 == REG && code1 == REG
+ && ((REGNO (arg0) < FIRST_PSEUDO_REGISTER
+ && REG_OK_FOR_BASE_P (arg0))
+ || ((REGNO (arg1) < FIRST_PSEUDO_REGISTER
+ && REG_OK_FOR_INDEX_P (arg1)))))
+ {
+ record_address_regs (arg0, BASE_REG_CLASS, scale);
+ record_address_regs (arg1, INDEX_REG_CLASS, scale);
+ }
+
+ /* Look for the sum of two registers where the first is definitely
+ an index register or the second is definitely a base register. */
+
+ else if (code0 == REG && code1 == REG
+ && ((REGNO (arg1) < FIRST_PSEUDO_REGISTER
+ && REG_OK_FOR_BASE_P (arg1))
+ || ((REGNO (arg0) < FIRST_PSEUDO_REGISTER
+ && REG_OK_FOR_INDEX_P (arg0)))))
+ {
+ record_address_regs (arg0, INDEX_REG_CLASS, scale);
+ record_address_regs (arg1, BASE_REG_CLASS, scale);
+ }
+
/* If this the sum of two registers where the first is known to be a
pointer, it must be a base register with the second an index. */