diff options
author | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-05-29 16:47:31 +0000 |
---|---|---|
committer | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-05-29 16:47:31 +0000 |
commit | 8d53b873fdcebaf0981b10073aea4734a49a78e6 (patch) | |
tree | 14c3f7d6586f4143d154f174b189c54456ded8e8 /gcc/testsuite/gcc.dg | |
parent | 7c1ab261537ea0c0411e3dc8750e6e7e4c442c5a (diff) | |
download | gcc-8d53b873fdcebaf0981b10073aea4734a49a78e6.tar.gz |
2009-05-29 Martin Jambor <mjambor@suse.cz>
* tree-sra.c: New implementation of SRA.
* params.def (PARAM_SRA_MAX_STRUCTURE_SIZE): Removed.
(PARAM_SRA_MAX_STRUCTURE_COUNT): Removed.
(PARAM_SRA_FIELD_STRUCTURE_RATIO): Removed.
* params.h (SRA_MAX_STRUCTURE_SIZE): Removed.
(SRA_MAX_STRUCTURE_COUNT): Removed.
(SRA_FIELD_STRUCTURE_RATIO): Removed.
* doc/invoke.texi (sra-max-structure-size): Removed.
(sra-field-structure-ratio): Removed.
* testsuite/gfortran.dg/pr25923.f90: XFAIL warning expectation.
* testsuite/gcc.dg/tree-ssa/ssa-fre-7.c: Compile with -fno-tree-sra.
* testsuite/gcc.dg/tree-ssa/ssa-fre-8.c: Likewise.
* testsuite/gcc.dg/tree-ssa/ssa-fre-9.c: Likewise.
* testsuite/gcc.dg/memcpy-1.c: Removed param sra-max-structure-size.
* testsuite/gcc.dg/tree-ssa/sra-2.c: Likewise.
* testsuite/gcc.dg/tree-ssa/sra-3.c: Likewise.
* testsuite/gcc.dg/tree-ssa/sra-1.c: Likewise.
* testsuite/gcc.dg/tree-ssa/sra-4.c: Changed comment.
* testsuite/gcc.dg/tree-ssa/sra-5.c: New file.
* testsuite/gcc.dg/tree-ssa/sra-6.c: New file.
* testsuite/gcc.c-torture/compile/sra-1.c: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147980 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/memcpy-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/sra-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/sra-2.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/sra-3.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/sra-4.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/sra-5.c | 74 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/sra-6.c | 40 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c | 2 |
10 files changed, 123 insertions, 11 deletions
diff --git a/gcc/testsuite/gcc.dg/memcpy-1.c b/gcc/testsuite/gcc.dg/memcpy-1.c index cc602423793..2b11098b286 100644 --- a/gcc/testsuite/gcc.dg/memcpy-1.c +++ b/gcc/testsuite/gcc.dg/memcpy-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-optimized --param sra-max-structure-size=32" } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ /* PR36598 AVR fail maybe due to cost metrics */ /* { dg-final { scan-tree-dump-times "nasty_local" 0 "optimized" { xfail { "avr-*-*" } } } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sra-1.c b/gcc/testsuite/gcc.dg/tree-ssa/sra-1.c index c2e45eb1f84..e5af2475115 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/sra-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/sra-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-optimized --param sra-max-structure-size=32" } */ +/* { dg-options "-O1 -fdump-tree-optimized" } */ /* Tests for SRA. */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sra-2.c b/gcc/testsuite/gcc.dg/tree-ssa/sra-2.c index 177c4bcace4..5682b8afbcf 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/sra-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/sra-2.c @@ -1,5 +1,5 @@ -/* { dg-do compile } */ -/* { dg-options "-O1 -fno-tree-fre -fdump-tree-optimized --param sra-max-structure-size=32" } */ +/* { dg-do compile } */ +/* { dg-options "-O1 -fno-tree-fre -fdump-tree-optimized" } */ /* Test for SRA. */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sra-3.c b/gcc/testsuite/gcc.dg/tree-ssa/sra-3.c index 661dc58ff09..d8908152384 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/sra-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/sra-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-optimized --param sra-max-structure-size=32" } */ +/* { dg-options "-O1 -fdump-tree-optimized" } */ /* Test for SRA. */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sra-4.c b/gcc/testsuite/gcc.dg/tree-ssa/sra-4.c index 6fdf37ffb34..73a68f90043 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/sra-4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/sra-4.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O1 -fdump-tree-optimized -w" } */ -/* Check that SRA does non block copies for structs that just contain vectors. */ +/* Check that SRA replaces strucutres containing vectors. */ #define vector __attribute__((vector_size(16))) @@ -20,7 +20,5 @@ vector int f(vector int t1, vector int t2) return st3.t; } -/* There should be no references to st as SRA should not have done block copy. */ /* { dg-final { scan-tree-dump-times "st" 0 "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ - diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sra-5.c b/gcc/testsuite/gcc.dg/tree-ssa/sra-5.c new file mode 100644 index 00000000000..869d2f55f95 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/sra-5.c @@ -0,0 +1,74 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -fdump-tree-optimized" } */ + +/* Tests for SRA of unions. */ + + +typedef union testunion +{ + double d; + char f1; +} testunion; + +void +copyunion1 (testunion param) +{ + testunion local; + param.f1 = 0; + local = param; + if (local.f1 != 0) + link_error (); +} + +void +copyunion11 (testunion *param) +{ + testunion local; + param->f1 = 0; + local = *param; + if (local.f1 != 0) + link_error (); +} + +void +copyunion111 (testunion param) +{ + testunion *local = ¶m; + param.f1 = 0; + if (local->f1 != 0) + link_error (); +} + +testunion globuf; +void +copyunion1111 (void) +{ + testunion local; + globuf.f1 = 0; + local = globuf; + if (local.f1 != 0) + link_error (); +} + +void +copyunion11111 (void) +{ + testunion *local = &globuf; + globuf.f1 = 0; + if (local->f1 != 0) + link_error (); +} + +void +copyunion111111 (testunion param) +{ + static testunion local; + param.f1 = 0; + local = param; + if (local.f1 != 0) + link_error (); +} + +/* There should be no reference to link_error. */ +/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sra-6.c b/gcc/testsuite/gcc.dg/tree-ssa/sra-6.c new file mode 100644 index 00000000000..e59b536c12d --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/sra-6.c @@ -0,0 +1,40 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -fdump-tree-optimized -fdump-tree-esra-details" } */ + +typedef struct teststruct +{ + double d; + int i1; + char c1; + float z; + char c2; + int i2; +} teststruct; + + +void cow (int i) +{ + teststruct a, b, c, d; + + a.d = 3.2; + a.i1 = i; + + b = a; + c = b; + d = c; + + if (d.i1 != i) + link_error (); +} + + +/* Suaccesses of b and c should have been created. */ +/* { dg-final { scan-tree-dump "expr = b.d" "esra"} } */ +/* { dg-final { scan-tree-dump "expr = b.i1" "esra"} } */ +/* { dg-final { scan-tree-dump "expr = c.d" "esra"} } */ +/* { dg-final { scan-tree-dump "expr = c.i1" "esra"} } */ +/* { dg-final { cleanup-tree-dump "esra" } } */ + +/* There should be no reference to link_error. */ +/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c index bd81831eba8..895c05fdf91 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-7.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre-details -fdump-tree-optimized" } */ +/* { dg-options "-O -fno-tree-sra -fdump-tree-fre-details -fdump-tree-optimized" } */ #if (__SIZEOF_INT__ == __SIZEOF_FLOAT__) typedef int intflt; #elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c index 6e17bd531b3..bc9f8e3992e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-8.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre-details" } */ +/* { dg-options "-O -fno-tree-sra -fdump-tree-fre-details" } */ #if (__SIZEOF_INT__ == __SIZEOF_FLOAT__) typedef int intflt; #elif (__SIZEOF_LONG__ == __SIZEOF_FLOAT__) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c index 18595ed6fe5..c8a434a2bba 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-9.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre-stats" } */ +/* { dg-options "-O -fno-tree-sra -fdump-tree-fre-stats" } */ union loc { unsigned reg; |