diff options
author | Richard Stallman <rms@gnu.org> | 1993-02-16 22:13:45 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-02-16 22:13:45 +0000 |
commit | b39555b4d7c9b2b95facaf17e61cbd324b3e3f01 (patch) | |
tree | 5d5f5fa01292a3009fab675b0bf40491063d209b /gcc | |
parent | c14f2655196e2279377f0f29664a423187ab1491 (diff) | |
download | gcc-b39555b4d7c9b2b95facaf17e61cbd324b3e3f01.zip gcc-b39555b4d7c9b2b95facaf17e61cbd324b3e3f01.tar.gz gcc-b39555b4d7c9b2b95facaf17e61cbd324b3e3f01.tar.bz2 |
(find_reloads_address): Use strict_memory_address_p
to check for valid indirect address.
From-SVN: r3478
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/reload.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/gcc/reload.c b/gcc/reload.c index 3ea095c..e0c3d59 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -3590,25 +3590,12 @@ find_reloads_address (mode, memrefloc, ad, loc, operand, ind_levels) return 1; } - else if (reg_equiv_mem[regno] != 0) - { - tem = XEXP (reg_equiv_mem[regno], 0); - - /* If we can't indirect any more, a pseudo must be reloaded. - If the pseudo's address in its MEM is a SYMBOL_REF, it - must be reloaded unless indirect_symref_ok. Otherwise, it - can be reloaded if the address is REG or REG + CONST_INT. */ - - if (ind_levels > 0 - && ! (GET_CODE (tem) == SYMBOL_REF && ! indirect_symref_ok) - && ((GET_CODE (tem) == REG - && REGNO (tem) < FIRST_PSEUDO_REGISTER) - || (GET_CODE (tem) == PLUS - && GET_CODE (XEXP (tem, 0)) == REG - && REGNO (XEXP (tem, 0)) < FIRST_PSEUDO_REGISTER - && GET_CODE (XEXP (tem, 1)) == CONST_INT))) - return 0; - } + /* We can avoid a reload if the register's equivalent memory expression + is valid as an indirect memory address. */ + + else if (reg_equiv_mem[regno] != 0 && ind_levels > 0 + && strict_memory_address_p (mode, reg_equiv_mem[regno])) + return 0; /* The only remaining case where we can avoid a reload is if this is a hard register that is valid as a base register and which is not the |