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/testsuite/gcc.dg | |
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/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr32721.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr32721.c b/gcc/testsuite/gcc.dg/pr32721.c new file mode 100644 index 0000000..392937e --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr32721.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +int spinlock[2]; +int main () +{ +volatile int * spinlock0; +volatile int * spinlock1; +spinlock0 = &spinlock[0]; +spinlock1 = &spinlock[1]; + +*spinlock0 = 0; +*spinlock1 = 0; + while (*spinlock0); +} + +/* { dg-final { scan-tree-dump "= spinlock.0." "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ |