summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-24 09:06:51 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-24 09:06:51 +0000
commite4a492cd76b0de5b3399658122bfbb7cb777406a (patch)
tree96987b9d66eaf9984c702ce4a997435fdc110ca2 /gcc/tree-inline.c
parentac117046d4f65a5ae7e28306be5cd33d79bf40d6 (diff)
downloadgcc-e4a492cd76b0de5b3399658122bfbb7cb777406a.tar.gz
2006-04-24 Andrew Pinski <pinskia@gcc.gnu.org>
Richard Guenther <rguenther@suse.de> PR tree-optimization/27236 * tree-inline.c (copy_body_r): Make sure to copy TREE_THIS_VOLATILE flag. * gcc.dg/tree-ssa/pr27236.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113221 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 6eb890b0ea2..309bb406fb8 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -590,6 +590,7 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
if (n)
{
tree new;
+ tree old;
/* If we happen to get an ADDR_EXPR in n->value, strip
it manually here as we'll eventually get ADDR_EXPRs
which lie about their types pointed to. In this case
@@ -598,13 +599,17 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
does other useful transformations, try that first, though. */
tree type = TREE_TYPE (TREE_TYPE ((tree)n->value));
new = unshare_expr ((tree)n->value);
+ old = *tp;
*tp = fold_indirect_ref_1 (type, new);
if (! *tp)
{
if (TREE_CODE (new) == ADDR_EXPR)
*tp = TREE_OPERAND (new, 0);
else
- *tp = build1 (INDIRECT_REF, type, new);
+ {
+ *tp = build1 (INDIRECT_REF, type, new);
+ TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
+ }
}
*walk_subtrees = 0;
return NULL;