summaryrefslogtreecommitdiff
path: root/gcc/cselib.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cselib.c')
-rw-r--r--gcc/cselib.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 7065429be8b..0aa22a4fe1b 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -1890,7 +1890,13 @@ cselib_record_sets (rtx insn)
src = gen_rtx_IF_THEN_ELSE (GET_MODE (dest), cond, src, dest);
sets[i].src_elt = cselib_lookup (src, GET_MODE (dest), 1);
if (MEM_P (dest))
- sets[i].dest_addr_elt = cselib_lookup (XEXP (dest, 0), Pmode, 1);
+ {
+ enum machine_mode address_mode
+ = targetm.addr_space.address_mode (MEM_ADDR_SPACE (dest));
+
+ sets[i].dest_addr_elt = cselib_lookup (XEXP (dest, 0),
+ address_mode, 1);
+ }
else
sets[i].dest_addr_elt = 0;
}