Add missing location to &MEM

Submitted by Richard Guenther on Aug. 29, 2011, 8:49 a.m.

Details

Message ID alpine.LNX.2.00.1108291048520.2130@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Guenther Aug. 29, 2011, 8:49 a.m.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2011-08-29  Richard Guenther  <rguenther@suse.de>

	* gimple-fold.c (gimple_fold_stmt_to_constant_1): Set a location
	on the built ADDR_EXPR.

Patch hide | download patch | download mbox

Index: gcc/gimple-fold.c
===================================================================
--- gcc/gimple-fold.c	(revision 178155)
+++ gcc/gimple-fold.c	(working copy)
@@ -2987,8 +2956,9 @@  gimple_fold_stmt_to_constant_1 (gimple s
 		  && TREE_CODE (op1) == INTEGER_CST)
 		{
 		  tree off = fold_convert (ptr_type_node, op1);
-		  return build_fold_addr_expr
-			   (fold_build2 (MEM_REF,
+		  return build_fold_addr_expr_loc
+			   (loc,
+			    fold_build2 (MEM_REF,
 					 TREE_TYPE (TREE_TYPE (op0)),
 					 unshare_expr (op0), off));
 		}