Fix PR middle-end/47017

Message ID
State New
Headers show

Commit Message

Eric Botcazou Jan. 3, 2011, 11:59 p.m.
This is another installment in the "RTL expansion of MEM_REF" series.  To 
recap, after the initial merge, Richard tweaked it to unbreak IA-64/HP-UX:
which broke SPARC64/Linux.  So I reverted the above change and installed:
instead, which pessimized x86.  So Jakub partially reverted it:
which broke SPARC64/Linux again (in exactly the same way as before).

The attached patchlet fixes again SPARC64/Linux by turning the call to 
convert_memory_address_addr_space into a call to memory_address_addr_space, 
which additionally makes sure that the memory address is valid.

Bootstrapped/regtested on SPARC64 and AMD64 Linux, applied on the mainline.

2011-01-03  Eric Botcazou  <>

	PR middle-end/47017
	* expr.c (expand_expr_real_1) <MEM_REF>: Call memory_address_addr_space
	instead of convert_memory_address_addr_space on the base expression.


Index: expr.c
--- expr.c	(revision 168391)
+++ expr.c	(working copy)
@@ -8731,7 +8731,7 @@  expand_expr_real_1 (tree exp, rtx target
 	align = MAX (TYPE_ALIGN (TREE_TYPE (exp)),
 		     get_object_alignment (exp, BIGGEST_ALIGNMENT));
 	op0 = expand_expr (base, NULL_RTX, VOIDmode, EXPAND_SUM);
-	op0 = convert_memory_address_addr_space (address_mode, op0, as);
+	op0 = memory_address_addr_space (address_mode, op0, as);
 	if (!integer_zerop (TREE_OPERAND (exp, 1)))
 	    rtx off