This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] fixing typo in expr.c to allow proper recognition of complex addresses in some arches.
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Igor Shevlyakov <igor at shevlyakov dot com>
- Date: Tue, 29 Oct 2013 13:10:50 +0100
- Subject: Re: [PATCH] fixing typo in expr.c to allow proper recognition of complex addresses in some arches.
- Authentication-results: sourceware.org; auth=none
- References: <CAB=oy59_ccY+ow8u3jmz3tZGjUwa+mR1PyNJf=-GYaj3UOM1aw at mail dot gmail dot com> <1512423 dot 4bAQFHQYqQ at polaris> <526ED6F6 dot 8060500 at redhat dot com>
> 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 <ebotcazou@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);