summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/reload.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3a8aea60513..dcadbdcc7a5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2001-01-09 Alan Lehotsky <lehotsky@tiac.net>
+
+ * reload.c (find_reloads_address): Check for eliminable registers
+ when substituting a constant expression for a pseudo.
+
2001-01-09 Joseph S. Myers <jsm28@cam.ac.uk>
* c-common.c (enum format_type): Add format_type_error.
diff --git a/gcc/reload.c b/gcc/reload.c
index 11e33f05fc8..533c28c9249 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -4487,10 +4487,14 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
{
regno = REGNO (ad);
- if (reg_equiv_constant[regno] != 0
- && strict_memory_address_p (mode, reg_equiv_constant[regno]))
+ /* If the register is equivalent to an invariant expression, substitute
+ the invariant, and eliminate any eliminable register references. */
+ tem = reg_equiv_constant[regno];
+ if (tem != 0
+ && (tem = eliminate_regs (tem, mode, insn))
+ && strict_memory_address_p (mode, tem))
{
- *loc = ad = reg_equiv_constant[regno];
+ *loc = ad = tem;
return 0;
}
OpenPOWER on IntegriCloud