From e4a492cd76b0de5b3399658122bfbb7cb777406a Mon Sep 17 00:00:00 2001 From: rguenth Date: Mon, 24 Apr 2006 09:06:51 +0000 Subject: 2006-04-24 Andrew Pinski Richard Guenther 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 --- gcc/tree-inline.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/tree-inline.c') 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; -- cgit v1.2.1