Patchwork Fix PR45176

login
register
mail settings
Submitter Richard Guenther
Date Aug. 4, 2010, 11:04 a.m.
Message ID <alpine.LNX.2.00.1008041304090.25856@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/60845/
State New
Headers show

Comments

Richard Guenther - Aug. 4, 2010, 11:04 a.m.
Oversight during mem-ref development.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2010-08-04  Richard Guenther  <rguenther@suse.de>

	PR middle-end/45176
	* expr.c (expand_expr_real_1): Also preserve TARGET_MEM_REF
	points-to set for original MEM_REF.

Patch

Index: gcc/expr.c
===================================================================
--- gcc/expr.c	(revision 162858)
+++ gcc/expr.c	(working copy)
@@ -8665,7 +8665,7 @@  expand_expr_real_1 (tree exp, rtx target
 	set_mem_addr_space (temp, as);
 	base = get_base_address (TMR_ORIGINAL (exp));
 	if (base
-	    && INDIRECT_REF_P (base)
+	    && (INDIRECT_REF_P (base) || TREE_CODE (base) == MEM_REF)
 	    && TMR_BASE (exp)
 	    && TREE_CODE (TMR_BASE (exp)) == SSA_NAME
 	    && POINTER_TYPE_P (TREE_TYPE (TMR_BASE (exp))))