diff options
Diffstat (limited to 'gcc/recog.c')
-rw-r--r-- | gcc/recog.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/recog.c b/gcc/recog.c index ee68e30..47e7f75 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -1942,6 +1942,9 @@ offsettable_address_addr_space_p (int strictp, enum machine_mode mode, rtx y, (strictp ? strict_memory_address_addr_space_p : memory_address_addr_space_p); unsigned int mode_sz = GET_MODE_SIZE (mode); +#ifdef POINTERS_EXTEND_UNSIGNED + enum machine_mode pointer_mode = targetm.addr_space.pointer_mode (as); +#endif if (CONSTANT_ADDRESS_P (y)) return 1; @@ -1991,6 +1994,15 @@ offsettable_address_addr_space_p (int strictp, enum machine_mode mode, rtx y, z = gen_rtx_LO_SUM (GET_MODE (y), XEXP (y, 0), plus_constant (GET_MODE (y), XEXP (y, 1), mode_sz - 1)); +#ifdef POINTERS_EXTEND_UNSIGNED + /* Likewise for a ZERO_EXTEND from pointer_mode. */ + else if (POINTERS_EXTEND_UNSIGNED > 0 + && GET_CODE (y) == ZERO_EXTEND + && GET_MODE (XEXP (y, 0)) == pointer_mode) + z = gen_rtx_ZERO_EXTEND (GET_MODE (y), + plus_constant (pointer_mode, XEXP (y, 0), + mode_sz - 1)); +#endif else z = plus_constant (GET_MODE (y), y, mode_sz - 1); |