> My reading of memory_address_addr_space is that MODE is the mode of the
> memory reference, not the mode of the address. I fail to see how
> passing in the mode of the address in the first call can be correct.
>
> What am I missing?
Nothing, it's me confusing
rtx memory_address_addr_space (enum machine_mode, rtx, addr_space_t);
with
rtx convert_memory_address_addr_space (enum machine_mode, rtx, addr_space_t);
for a long time apparently... Sorry about that. In the meantime, I installed
the obvious patch to eliminate the small redundancy. Tested on x86_64/Linux.
2013-10-29 Eric Botcazou <ebotca...@adacore.com>
* expr.c (expand_expr_real_1) <MEM_EXPR>: Eliminate small redundancy.
--
Eric Botcazou
Index: expr.c
===================================================================
--- expr.c (revision 204106)
+++ expr.c (working copy)
@@ -9648,8 +9648,8 @@ expand_expr_real_1 (tree exp, rtx target
rtx off
= immed_double_int_const (mem_ref_offset (exp), address_mode);
op0 = simplify_gen_binary (PLUS, address_mode, op0, off);
+ op0 = memory_address_addr_space (mode, op0, as);
}
- op0 = memory_address_addr_space (mode, op0, as);
temp = gen_rtx_MEM (mode, op0);
set_mem_attributes (temp, exp, 0);
set_mem_addr_space (temp, as);