diff mbox

fixing typo in expr.c to allow proper recognition of complex addresses in some arches.

Message ID 5649593.7oSYlqBFcM@polaris
State New
Headers show

Commit Message

Eric Botcazou Oct. 29, 2013, 12:10 p.m. UTC
> 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.

Comments

Jeff Law Oct. 29, 2013, 3:45 p.m. UTC | #1
On 10/29/13 06:10, Eric Botcazou wrote:
>> 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.
No worries.  At one time I kept reading memory_address_addr_space_p and 
couldn't reconcile how the return value was used.  Eventually I realized 
I needed to be reading memory_address_space_addr_space instead.  Ugh.

Jeff
diff mbox

Patch

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);