Patchwork Fix PR middle-end/47017

login
register
mail settings
Submitter Eric Botcazou
Date Jan. 3, 2011, 11:59 p.m.
Message ID <201101040059.09592.ebotcazou@adacore.com>
Download mbox | patch
Permalink /patch/77357/
State New
Headers show

Comments

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:
  http://gcc.gnu.org/ml/gcc-patches/2010-07/msg00514.html
which broke SPARC64/Linux.  So I reverted the above change and installed:
  http://gcc.gnu.org/ml/gcc-patches/2010-07/msg02144.html
instead, which pessimized x86.  So Jakub partially reverted it:
  http://gcc.gnu.org/ml/gcc-patches/2010-11/msg00551.html
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  <ebotcazou@adacore.com>

	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.

Patch

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