2013-04-30 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / volatile2.c
blobd663123c83db97e5437baa809ea72a9af56d2555
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 struct GTeth_desc
6 unsigned ed_cmdsts;
7 };
8 struct GTeth_softc
10 struct GTeth_desc txq_desc[32];
13 void foo(struct GTeth_softc *sc)
15 /* Verify that we retain the volatileness on the
16 store until after optimization. */
17 volatile struct GTeth_desc *p = &sc->txq_desc[0];
18 p->ed_cmdsts = 0;
21 /* { dg-final { scan-tree-dump "{v}" "optimized" } } */
22 /* { dg-final { cleanup-tree-dump "optimized" } } */