diff options
Diffstat (limited to 'gcc/recog.c')
-rw-r--r-- | gcc/recog.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/recog.c b/gcc/recog.c index 5058da2..f28b021 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -629,7 +629,8 @@ simplify_while_replacing (rtx *loc, rtx to, rtx object, if (MEM_P (XEXP (x, 0)) && CONST_INT_P (XEXP (x, 1)) && CONST_INT_P (XEXP (x, 2)) - && !mode_dependent_address_p (XEXP (XEXP (x, 0), 0)) + && !mode_dependent_address_p (XEXP (XEXP (x, 0), 0), + MEM_ADDR_SPACE (XEXP (x, 0))) && !MEM_VOLATILE_P (XEXP (x, 0))) { enum machine_mode wanted_mode = VOIDmode; @@ -1945,7 +1946,7 @@ offsettable_address_addr_space_p (int strictp, enum machine_mode mode, rtx y, /* Adjusting an offsettable address involves changing to a narrower mode. Make sure that's OK. */ - if (mode_dependent_address_p (y)) + if (mode_dependent_address_p (y, as)) return 0; /* ??? How much offset does an offsettable BLKmode reference need? @@ -1998,11 +1999,13 @@ offsettable_address_addr_space_p (int strictp, enum machine_mode mode, rtx y, /* Return 1 if ADDR is an address-expression whose effect depends on the mode of the memory reference it is used in. + ADDRSPACE is the address space associated with the address. + Autoincrement addressing is a typical example of mode-dependence because the amount of the increment depends on the mode. */ bool -mode_dependent_address_p (rtx addr) +mode_dependent_address_p (rtx addr, addr_space_t addrspace) { /* Auto-increment addressing with anything other than post_modify or pre_modify always introduces a mode dependency. Catch such @@ -2013,7 +2016,7 @@ mode_dependent_address_p (rtx addr) || GET_CODE (addr) == POST_DEC) return true; - return targetm.mode_dependent_address_p (addr); + return targetm.mode_dependent_address_p (addr, addrspace); } /* Like extract_insn, but save insn extracted and don't extract again, when |