diff options
author | Richard Stallman <rms@gnu.org> | 1993-06-28 07:44:08 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-06-28 07:44:08 +0000 |
commit | c1875d66e2a342b3edcedc09115b3ef2dcd6aea3 (patch) | |
tree | fb3842df11f0e4fe554c80488cbfe76c53d6fd9f | |
parent | 8b3d02513eb1b096d82d116d8db80c7374c814b7 (diff) | |
download | gcc-c1875d66e2a342b3edcedc09115b3ef2dcd6aea3.zip gcc-c1875d66e2a342b3edcedc09115b3ef2dcd6aea3.tar.gz gcc-c1875d66e2a342b3edcedc09115b3ef2dcd6aea3.tar.bz2 |
(find_reloads_address): Be selective about what inner
addresses to allow in an indirect mem ref.
From-SVN: r4783
-rw-r--r-- | gcc/reload.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/reload.c b/gcc/reload.c index 2a0026c..35fe843 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -3888,10 +3888,16 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels) } /* We can avoid a reload if the register's equivalent memory expression - is valid as an indirect memory address. */ + is valid as an indirect memory address. + But not all addresses are valid in a mem used as an indirect address: + only reg or reg+constant. */ else if (reg_equiv_mem[regno] != 0 && ind_levels > 0 - && strict_memory_address_p (mode, reg_equiv_mem[regno])) + && strict_memory_address_p (mode, reg_equiv_mem[regno]) + && (GET_CODE (XEXP (reg_equiv_mem[regno], 0)) == REG + || (GET_CODE (XEXP (reg_equiv_mem[regno], 0)) == PLUS + && GET_CODE (XEXP (XEXP (reg_equiv_mem[regno], 0), 0)) == REG + && CONSTANT_P (XEXP (XEXP (reg_equiv_mem[regno], 0), 0))))) return 0; /* The only remaining case where we can avoid a reload is if this is a |