aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-03-20 13:25:08 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-03-20 13:25:08 +0000
commit54714c680a46d4290c10b7369c1c1b2afd1e8d97 (patch)
tree1dd741b72eba93c6842b05b9aaa0e7a164f445c1 /gcc/tree-inline.c
parentcca1130d11997d40bd37603fab5953ccf8061331 (diff)
downloadgcc-54714c680a46d4290c10b7369c1c1b2afd1e8d97.zip
gcc-54714c680a46d4290c10b7369c1c1b2afd1e8d97.tar.gz
gcc-54714c680a46d4290c10b7369c1c1b2afd1e8d97.tar.bz2
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
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 5121765..b7f76c8 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1092,22 +1092,22 @@ copy_tree_body_r (tree *tp, int *walk_subtrees, void *data)
}
else if (TREE_CODE (*tp) == MEM_REF)
{
- /* We need to re-canonicalize MEM_REFs from inline substitutions
- that can happen when a pointer argument is an ADDR_EXPR. */
- tree decl = TREE_OPERAND (*tp, 0);
- tree *n;
+ tree ptr = TREE_OPERAND (*tp, 0);
+ tree type = remap_type (TREE_TYPE (*tp), id);
+ tree old = *tp;
- n = (tree *) pointer_map_contains (id->decl_map, decl);
- if (n)
- {
- tree old = *tp;
- *tp = fold_build2 (MEM_REF, TREE_TYPE (*tp),
- unshare_expr (*n), TREE_OPERAND (*tp, 1));
- TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
- TREE_NO_WARNING (*tp) = TREE_NO_WARNING (old);
- *walk_subtrees = 0;
- return NULL;
- }
+ /* We need to re-canonicalize MEM_REFs from inline substitutions
+ that can happen when a pointer argument is an ADDR_EXPR.
+ Recurse here manually to allow that. */
+ walk_tree (&ptr, copy_tree_body_r, data, NULL);
+ *tp = fold_build2 (MEM_REF, type,
+ ptr, TREE_OPERAND (*tp, 1));
+ TREE_THIS_NOTRAP (*tp) = TREE_THIS_NOTRAP (old);
+ TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
+ TREE_SIDE_EFFECTS (*tp) = TREE_SIDE_EFFECTS (old);
+ TREE_NO_WARNING (*tp) = TREE_NO_WARNING (old);
+ *walk_subtrees = 0;
+ return NULL;
}
/* Here is the "usual case". Copy this tree node, and then