diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-13 15:41:02 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-13 15:41:02 +0000 |
commit | 5acf83059e6f7ff2abfad7be86598013db509c6f (patch) | |
tree | 09665852468f06599133d7e15cdbb53604802650 /gcc/tree-ssa-ccp.c | |
parent | f82380e4321a278757b21cd8919e33183b39a733 (diff) | |
download | gcc-5acf83059e6f7ff2abfad7be86598013db509c6f.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126624 138bc75d-0d04-0410-961f-82ee72b054a4
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 272a4f85741..93345a99ccc 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 { |