diff options
author | uweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-22 22:09:12 +0000 |
---|---|---|
committer | uweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-22 22:09:12 +0000 |
commit | e45424352d8ee0cb8c77311d8ea79993875efb09 (patch) | |
tree | aacc554b79463f2000c1ff1d2e71c98b7ddc340f /gcc/reload.c | |
parent | 0c8fe10f97135696161ac53fd73669c25e2cbe57 (diff) | |
download | gcc-e45424352d8ee0cb8c77311d8ea79993875efb09.tar.gz |
* reload.c (find_reloads_address): Make return value tri-state.
Return -1 if LEGITIMIZE_RELOAD_ADDRESS succeeded.
(find_reloads): Assume that reloaded addresses match 'o' or
EXTRA_MEMORY_CONSTRAINT constraints only if find_reloads_address
returned 1 (not -1). Omit optional reloads for address operands
only if find_reloads_address returned 1 (not -1).
* config/s390/s390.c (legitimize_reload_address): New function.
* config/s390/s390-protos.h (legitimize_reload_address): Declare.
* config/s390/s390.h (LEGITIMIZE_RELOAD_ADDRESS): Define. Call
legitimize_reload_address.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86388 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload.c')
-rw-r--r-- | gcc/reload.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/reload.c b/gcc/reload.c index b3f7db80f9f..260e4b7a3aa 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -2485,9 +2485,11 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, a register. */ enum reg_class preferred_class[MAX_RECOG_OPERANDS]; char pref_or_nothing[MAX_RECOG_OPERANDS]; - /* Nonzero for a MEM operand whose entire address needs a reload. */ + /* Nonzero for a MEM operand whose entire address needs a reload. + May be -1 to indicate the entire address may or may not need a reload. */ int address_reloaded[MAX_RECOG_OPERANDS]; - /* Nonzero for an address operand that needs to be completely reloaded. */ + /* Nonzero for an address operand that needs to be completely reloaded. + May be -1 to indicate the entire operand may or may not need a reload. */ int address_operand_reloaded[MAX_RECOG_OPERANDS]; /* Value of enum reload_type to use for operand. */ enum reload_type operand_type[MAX_RECOG_OPERANDS]; @@ -3180,7 +3182,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, : offsettable_nonstrict_memref_p (operand)) /* A reloaded address is offsettable because it is now just a simple register indirect. */ - || address_reloaded[i])) + || address_reloaded[i] == 1)) || (REG_P (operand) && REGNO (operand) >= FIRST_PSEUDO_REGISTER && reg_renumber[REGNO (operand)] < 0 @@ -3291,7 +3293,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, /* If the address was already reloaded, we win as well. */ else if (MEM_P (operand) - && address_reloaded[i]) + && address_reloaded[i] == 1) win = 1; /* Likewise if the address will be reloaded because reg_equiv_address is nonzero. For reg_equiv_mem @@ -3891,7 +3893,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, } else if (goal_alternative_matched[i] < 0 && goal_alternative_matches[i] < 0 - && !address_operand_reloaded[i] + && address_operand_reloaded[i] != 1 && optimize) { /* For each non-matching operand that's a MEM or a pseudo-register @@ -4631,8 +4633,9 @@ maybe_memory_address_p (enum machine_mode mode, rtx ad, rtx *part) to determine if we may generate output reloads, and where to put USEs for pseudos that we have to replace with stack slots. - Value is nonzero if this address is reloaded or replaced as a whole. - This is interesting to the caller if the address is an autoincrement. + Value is one if this address is reloaded or replaced as a whole; it is + zero if the top level of this address was not reloaded or replaced, and + it is -1 if it may or may not have been reloaded or replaced. Note that there is no verification that the address will be valid after this routine does its work. Instead, we rely on the fact that the address @@ -4771,7 +4774,7 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad, *memrefloc = copy_rtx (*memrefloc); XEXP (*memrefloc, 0) = ad; move_replacements (&ad, &XEXP (*memrefloc, 0)); - return 1; + return -1; } while (0); #endif |