Commit 54714c68 by Richard Biener Committed by Richard Biener

tree-inline.c (copy_tree_body_r): Sync MEM_REF code with remap_gimple_op_r.

2013-03-20  Richard Biener  <rguenther@suse.de>

	* tree-inline.c (copy_tree_body_r): Sync MEM_REF code with
	remap_gimple_op_r.

From-SVN: r196824
parent cca1130d
2013-03-20 Richard Biener <rguenther@suse.de>
* tree-inline.c (copy_tree_body_r): Sync MEM_REF code with
remap_gimple_op_r.
2013-03-20 Bill Schmidt <wschmidt@linux.vnet.ibm.com> 2013-03-20 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Steven Bosscher <steven@gcc.gnu.org> Steven Bosscher <steven@gcc.gnu.org>
......
...@@ -1092,22 +1092,22 @@ copy_tree_body_r (tree *tp, int *walk_subtrees, void *data) ...@@ -1092,22 +1092,22 @@ copy_tree_body_r (tree *tp, int *walk_subtrees, void *data)
} }
else if (TREE_CODE (*tp) == MEM_REF) else if (TREE_CODE (*tp) == MEM_REF)
{ {
/* We need to re-canonicalize MEM_REFs from inline substitutions tree ptr = TREE_OPERAND (*tp, 0);
that can happen when a pointer argument is an ADDR_EXPR. */ tree type = remap_type (TREE_TYPE (*tp), id);
tree decl = TREE_OPERAND (*tp, 0); tree old = *tp;
tree *n;
n = (tree *) pointer_map_contains (id->decl_map, decl); /* We need to re-canonicalize MEM_REFs from inline substitutions
if (n) that can happen when a pointer argument is an ADDR_EXPR.
{ Recurse here manually to allow that. */
tree old = *tp; walk_tree (&ptr, copy_tree_body_r, data, NULL);
*tp = fold_build2 (MEM_REF, TREE_TYPE (*tp), *tp = fold_build2 (MEM_REF, type,
unshare_expr (*n), TREE_OPERAND (*tp, 1)); ptr, TREE_OPERAND (*tp, 1));
TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old); TREE_THIS_NOTRAP (*tp) = TREE_THIS_NOTRAP (old);
TREE_NO_WARNING (*tp) = TREE_NO_WARNING (old); TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
*walk_subtrees = 0; TREE_SIDE_EFFECTS (*tp) = TREE_SIDE_EFFECTS (old);
return NULL; TREE_NO_WARNING (*tp) = TREE_NO_WARNING (old);
} *walk_subtrees = 0;
return NULL;
} }
/* Here is the "usual case". Copy this tree node, and then /* Here is the "usual case". Copy this tree node, and then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment