diff mbox

Improve EXPAND_SUM handling in expand_expr_addr_expr* (PR middle-end/50074)

Message ID 20111125205818.GR27242@tyan-ft48-01.lab.bos.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Nov. 25, 2011, 8:58 p.m. UTC
Hi!

While looking at this PR, I was first surprised that on i?86
we got pseudo = argp + 4 and mem_overlap* was called with
that pseudo + 4 etc.  I don't see why we should force the address
into register for EXPAND_SUM modifier, with this mem_overlap* sees
argp + 8 etc. directly (on i?86, of course on ia64 it still sees
a register and thus the other patch I've posted is needed).

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2011-11-25  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/50074
	* expr.c (expand_expr_addr_expr_1): Don't call force_operand for
	EXPAND_SUM modifier.


	Jakub

Comments

Richard Henderson Nov. 29, 2011, 4:03 a.m. UTC | #1
On 11/25/2011 12:58 PM, Jakub Jelinek wrote:
> 	PR middle-end/50074
> 	* expr.c (expand_expr_addr_expr_1): Don't call force_operand for
> 	EXPAND_SUM modifier.

Ok.


r~
diff mbox

Patch

--- gcc/expr.c.jj	2011-11-21 16:22:02.000000000 +0100
+++ gcc/expr.c	2011-11-25 12:46:40.070831662 +0100
@@ -7452,7 +7452,8 @@  expand_expr_addr_expr_1 (tree exp, rtx t
 	    }
 
 	  if (modifier != EXPAND_INITIALIZER
-	      && modifier != EXPAND_CONST_ADDRESS)
+	      && modifier != EXPAND_CONST_ADDRESS
+	      && modifier != EXPAND_SUM)
 	    result = force_operand (result, target);
 	  return result;
 	}