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 | |
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')
-rw-r--r-- | gcc/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr32721.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/volatile2.c | 25 |
6 files changed, 43 insertions, 14 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e98ef342544..1fcf11e92ef 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2007-09-04 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/33291 + * 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. + 2007-09-03 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/33253 diff --git a/gcc/testsuite/gcc.dg/pr32721.c b/gcc/testsuite/gcc.dg/pr32721.c index bd67c79521e..2f3a18a8815 100644 --- a/gcc/testsuite/gcc.dg/pr32721.c +++ b/gcc/testsuite/gcc.dg/pr32721.c @@ -14,5 +14,5 @@ spinlock1 = &spinlock[1]; while (*spinlock0); } -/* { dg-final { scan-tree-dump "={v} spinlock.0." "optimized" } } */ +/* { dg-final { scan-tree-dump "={v} \\*spinlock0" "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c index ee7f049c664..c1fa43543c1 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-forwprop" } */ +/* { dg-options "-O2 -fdump-tree-forwprop1" } */ /* We should be able to optimize this to b->t[i] = 1 during early optimizations. */ @@ -15,8 +15,5 @@ void f(struct a * b, __SIZE_TYPE__ i) c[i] = 1; } -/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop1" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop2" } } */ -/* { dg-final { cleanup-tree-dump "forwprop?" } } */ - - +/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop1" } } */ +/* { dg-final { cleanup-tree-dump "forwprop1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c index 95aa77eb3f7..434d86c65d5 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-forwprop" } */ +/* { dg-options "-O2 -fdump-tree-forwprop1" } */ /* We should be able to optimize this to b->t[i] = 1 during early optimizations. */ @@ -17,6 +17,5 @@ void f(__SIZE_TYPE__ i) c[i] = 1; } -/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop1" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop2" } } */ +/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop1" } } */ /* { dg-final { cleanup-tree-dump "forwprop?" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c index f517c89b185..af867515002 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-forwprop" } */ +/* { dg-options "-O2 -fdump-tree-forwprop1" } */ struct A { int i; }; int @@ -11,6 +11,5 @@ foo(struct A *locp, int str) return locp->i; } -/* { dg-final { scan-tree-dump "locp.*->i =" "forwprop1" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump "locp.*->i =" "forwprop2" } } */ -/* { dg-final { cleanup-tree-dump "forwprop?" } } */ +/* { dg-final { scan-tree-dump "locp.*->i =" "forwprop1" } } */ +/* { dg-final { cleanup-tree-dump "forwprop1" } } */ 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" } } */ |