diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-04 08:38:56 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-09-04 08:38:56 +0000 |
commit | d382842149f6d0cf30f1240addc04e857366d66d (patch) | |
tree | 333af519eb1ef7bdaff0a09aeb9d6248eee3cef5 /gcc/testsuite/gcc.dg/volatile2.c | |
parent | 957788b0003fcf16fa17bd10c5875881e294f3d1 (diff) | |
download | gcc-d382842149f6d0cf30f1240addc04e857366d66d.tar.gz |
2007-09-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/33291
* tree-pretty-print.c (dump_generic_node): Dump all
qualifiers for pointer types, not only first. Dump
qualifiers for aggregate types as well.
* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Always
use the canonical type for building ARRAY_REFs.
* gimplify.c (canonicalize_addr_expr): Clean up. The
correct validness check is compatibility of the pointer
types. Always use the canonical type for building
ARRAY_REFs and ADDR_EXPRs.
* tree-ssa-forwprop.c (forward_propagate_addr_expr): Revert
change that disabled propagation of ADDR_EXPRs into statements
with volatile ops.
* gcc.dg/volatile2.c: New testcase.
* gcc.dg/pr32721.c: Adjust volatile reference pattern.
* gcc.dg/tree-ssa/forwprop-1.c: Remove xfail.
* gcc.dg/tree-ssa/forwprop-2.c: Likewise.
* gcc.dg/tree-ssa/pr17141-1.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128068 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/volatile2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/volatile2.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/volatile2.c b/gcc/testsuite/gcc.dg/volatile2.c new file mode 100644 index 00000000000..4bfc441c862 --- /dev/null +++ b/gcc/testsuite/gcc.dg/volatile2.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-gimple -fdump-tree-optimized" } */ + +struct GTeth_desc +{ + unsigned ed_cmdsts; +}; +struct GTeth_softc +{ + struct GTeth_desc txq_desc[32]; +}; + +void foo(struct GTeth_softc *sc) +{ + /* Verify that we retain the cast to (volatile struct GTeth_desc *) + after gimplification and that we keep the volatileness on the + store until after optimization. */ + volatile struct GTeth_desc *p = &sc->txq_desc[0]; + p->ed_cmdsts = 0; +} + +/* { dg-final { scan-tree-dump "\\(volatile struct GTeth_desc \\*\\) D" "gimple" } } */ +/* { dg-final { scan-tree-dump "{v}" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "gimple" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ |