aboutsummaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2012-09-26 13:46:29 +0000
committerGeorg-Johann Lay <gjl@gcc.gnu.org>2012-09-26 13:46:29 +0000
commit5bfed9a91f036d8c168afebfd8e9dd34e2919c9a (patch)
tree91a9229d2e7d90865629ad03c4b391936c79877e /gcc/recog.c
parent1df855ce3547caa8bd375e53e5f2effac5472b43 (diff)
downloadgcc-5bfed9a91f036d8c168afebfd8e9dd34e2919c9a.zip
gcc-5bfed9a91f036d8c168afebfd8e9dd34e2919c9a.tar.gz
gcc-5bfed9a91f036d8c168afebfd8e9dd34e2919c9a.tar.bz2
re PR middle-end/54635 (Add addr_space_t argument to TARGET_MODE_DEPENDENT_ADDRESS_P)
PR middle-end/54635 * doc/tm.texi.in (TARGET_MODE_DEPENDENT_ADDRESS_P): Document new parameter addrspace. * doc/tm.texi: Regenerate. * target.def (mode_dependent_address_p): Add addr_space_t parameter. * targhooks.h (default_mode_dependent_address_p): Ditto. * targhooks.c (default_mode_dependent_address_p): Ditto. * expr.c (convert_move): Pass address space to mode_dependent_address_p. * combine.c (combine_simplify_rtx): Ditto. (make_extraction): Ditto. (simplify_shift_const_1): Ditto. (gen_lowpart_for_combine): Ditto. * lower-subreg.c (simple_move_operand): Ditto. * recog.c (simplify_while_replacing): Ditto. (offsettable_address_addr_space_p): Ditto. (mode_dependent_address_p): Ditto. * simplify-rtx.c (simplify_unary_operation_1): Ditto. (simplify_subreg): Ditto. * config/m68k/m68k.md: Ditto. * config/vax/vax.md: Ditto. * config/vax/constraints.md (Q): Ditto. * config/vax/predicates.md (indexed_memory_operand): Ditto. * config/alpha/alpha.c (alpha_mode_dependent_address_p): Add unused addr_space_t parameter. * config/avr/avr.c (avr_mode_dependent_address_p): Ditto. * config/h8300/h8300.c (h8300_mode_dependent_address_p): Ditto. * config/m32r/m32r.c (m32r_mode_dependent_address_p): Ditto. * config/rs6000/rs6000.c (rs6000_mode_dependent_address_p): Ditto. * config/rx/rx.c (rx_mode_dependent_address_p): Ditto. * config/sparc/sparc.c (sparc_mode_dependent_address_p): Ditto. * config/stormy16/stormy16.c (xstormy16_mode_dependent_address_p): Ditto. * config/vax/vax.c (vax_mode_dependent_address_p): Ditto. * config/xtensa/xtensa.c (xtensa_mode_dependent_address_p): Ditto. From-SVN: r191761
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c11
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