diff options
author | Richard Guenther <rguenther@suse.de> | 2007-07-13 15:41:02 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-07-13 15:41:02 +0000 |
commit | cbf8d355b8ea5cdbbc02ac0ab0433aaa79431a3b (patch) | |
tree | 09665852468f06599133d7e15cdbb53604802650 /gcc/tree-ssa-ccp.c | |
parent | 05724daed2ffba316e84fcd45f02221d52e4fa95 (diff) | |
download | gcc-cbf8d355b8ea5cdbbc02ac0ab0433aaa79431a3b.zip gcc-cbf8d355b8ea5cdbbc02ac0ab0433aaa79431a3b.tar.gz gcc-cbf8d355b8ea5cdbbc02ac0ab0433aaa79431a3b.tar.bz2 |
re PR tree-optimization/32721 (CCP removes volatile qualifiers.)
2007-07-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/32721
* tree-ssa-ccp.c (maybe_fold_stmt_indirect): Preserve
TREE_THIS_VOLATILE on the folded reference.
* tree-ssa-operands.c (get_expr_operands): Set has_volatile_ops
if the array reference has TREE_THIS_VOLATILE set.
* gcc.dg/pr32721.c: New testcase.
From-SVN: r126624
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 272a4f8..93345a9 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -1839,6 +1839,7 @@ static tree maybe_fold_stmt_indirect (tree expr, tree base, tree offset) { tree t; + bool volatile_p = TREE_THIS_VOLATILE (expr); /* We may well have constructed a double-nested PLUS_EXPR via multiple substitutions. Fold that down to one. Remove NON_LVALUE_EXPRs that @@ -1882,7 +1883,10 @@ maybe_fold_stmt_indirect (tree expr, tree base, tree offset) t = maybe_fold_offset_to_reference (base_addr, offset, TREE_TYPE (expr)); if (t) - return t; + { + TREE_THIS_VOLATILE (t) = volatile_p; + return t; + } } else { |