summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr32721.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-13 15:41:02 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-07-13 15:41:02 +0000
commit5acf83059e6f7ff2abfad7be86598013db509c6f (patch)
tree09665852468f06599133d7e15cdbb53604802650 /gcc/testsuite/gcc.dg/pr32721.c
parentf82380e4321a278757b21cd8919e33183b39a733 (diff)
downloadgcc-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/testsuite/gcc.dg/pr32721.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr32721.c18
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 00000000000..392937ebbf6
--- /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" } } */