diff options
author | Richard Guenther <rguenther@suse.de> | 2010-10-18 15:32:00 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-10-18 15:32:00 +0000 |
commit | 0f8d6231573675f483e50a283ccc20251b377ab4 (patch) | |
tree | 02cbaf0300d83a152360f7d67a78514ee12a19f2 /gcc/testsuite | |
parent | 1915c739f0010675511d273e01e184507f5c99fb (diff) | |
download | gcc-0f8d6231573675f483e50a283ccc20251b377ab4.zip gcc-0f8d6231573675f483e50a283ccc20251b377ab4.tar.gz gcc-0f8d6231573675f483e50a283ccc20251b377ab4.tar.bz2 |
re PR tree-optimization/45967 (gcc-4.5.x optimizes code with side-effects away)
2010-10-18 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45967
* tree-ssa-structalias.c (type_could_have_pointers): Remove.
(could_have_pointers): Likewise.
(handle_rhs_call, handle_const_call, handle_pure_call,
find_func_aliases, intra_create_variable_infos): Remove calls to them.
(struct fieldoff): Add must_have_pointers field.
(type_must_have_pointers): New function.
(field_must_have_pointers): Likewise.
(push_fields_onto_fieldstack): Remove must_have_pointers_p argument.
Adjust field merging.
(create_function_info_for): May-have-pointers of varinfo is
almost always true.
(create_variable_info_for_1): Likewise.
* gcc.dg/torture/pr45967.c: New testcase.
* gcc.dg/ipa/ipa-pta-10.c: Adjust.
* gcc.dg/ipa/ipa-pta-13.c: Likewise
* gcc.dg/torture/pr39074-2.c: Likewise
* gcc.dg/torture/pta-escape-1.c: Likewise
* gcc.dg/torture/pta-ptrarith-1.c: Likewise
* gcc.dg/tree-ssa/pta-callused.c: Likewise
* gcc.dg/tree-ssa/pta-escape-1.c: Likewise
* gcc.dg/tree-ssa/pta-escape-2.c: Likewise
* gcc.dg/tree-ssa/pta-escape-3.c: Likewise
* gcc.dg/tree-ssa/ssa-pre-21.c: Likewise
From-SVN: r165641
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipa-pta-10.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr39074-2.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr45967.c | 21 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pta-escape-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/pta-escape-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/pta-escape-2.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/pta-escape-3.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-21.c | 2 |
12 files changed, 54 insertions, 12 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4295e4e..6a2738f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,18 @@ +2010-10-18 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/45967 + * gcc.dg/torture/pr45967.c: New testcase. + * gcc.dg/ipa/ipa-pta-10.c: Adjust. + * gcc.dg/ipa/ipa-pta-13.c: Likewise + * gcc.dg/torture/pr39074-2.c: Likewise + * gcc.dg/torture/pta-escape-1.c: Likewise + * gcc.dg/torture/pta-ptrarith-1.c: Likewise + * gcc.dg/tree-ssa/pta-callused.c: Likewise + * gcc.dg/tree-ssa/pta-escape-1.c: Likewise + * gcc.dg/tree-ssa/pta-escape-2.c: Likewise + * gcc.dg/tree-ssa/pta-escape-3.c: Likewise + * gcc.dg/tree-ssa/ssa-pre-21.c: Likewise + 2010-10-18 Kai Tietz <kai.tietz@onevision.com> * gfortran.dg/bessel_7.f90: Set xfail for mingw targets. diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-pta-10.c b/gcc/testsuite/gcc.dg/ipa/ipa-pta-10.c index 2dc6eae..6e4c3c5 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-pta-10.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-pta-10.c @@ -26,5 +26,5 @@ int main() /* Verify we properly handle variadic arguments and do not let escape stuff through it. */ -/* { dg-final { scan-ipa-dump "ESCAPED = { }" "pta" } } */ +/* { dg-final { scan-ipa-dump "ESCAPED = { ESCAPED NONLOCAL }" "pta" } } */ /* { dg-final { cleanup-ipa-dump "pta" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c b/gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c index 8c2c8b6..1e04bfc 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-pta-13.c @@ -15,6 +15,8 @@ local_address_taken (int *p) *p = 1; } +void *anyfn_global; + /* Even though not referenced in this TU we should have added constraints for the initializer. */ /* { dg-final { scan-ipa-dump "ex = &local_address_taken" "pta" } } */ @@ -24,7 +26,7 @@ extern void link_error (void); int main() { - void (*anyfn)(int *) = (void (*)(int *))(__SIZE_TYPE__)x; + void (*anyfn)(int *) = (void (*)(int *))(__SIZE_TYPE__)anyfn_global; /* The following should cause local_address_taken to get &x as argument, but not local. We shouldn't get &x added to arbitrary special sub-vars of local_address_taken though, @@ -34,9 +36,13 @@ int main() We shouldn't get the functions sub-vars in the ESCAPED solution though, another missed-optimization. This also causes the functions uses to be messed up even further. */ - /* { dg-final { scan-ipa-dump "local_address_taken.arg0 = { ESCAPED NONLOCAL y x }" "pta" } } */ - /* { dg-final { scan-ipa-dump "local_address_taken.clobber = { ESCAPED NONLOCAL y x }" "pta" } } */ + /* ??? As we don't expand the ESCAPED solution we either get x printed here + or not based on the phase of the moon. */ + /* { dg-final { scan-ipa-dump "local_address_taken.arg0 = { ESCAPED NONLOCAL y x }" "pta" { xfail *-*-* } } } */ + /* { dg-final { scan-ipa-dump "local_address_taken.clobber = { ESCAPED NONLOCAL y x }" "pta" { xfail *-*-* } } } */ /* { dg-final { scan-ipa-dump "local_address_taken.use = { }" "pta" { xfail *-*-* } } } */ + /* ??? But make sure x really escaped. */ + /* { dg-final { scan-ipa-dump "ESCAPED = {\[^\n\}\]* x \[^\n\}\]*}" "pta" } } */ (*anyfn) (&x); x = 0; local (&y); diff --git a/gcc/testsuite/gcc.dg/torture/pr39074-2.c b/gcc/testsuite/gcc.dg/torture/pr39074-2.c index 0ca8312..a90c564 100644 --- a/gcc/testsuite/gcc.dg/torture/pr39074-2.c +++ b/gcc/testsuite/gcc.dg/torture/pr39074-2.c @@ -30,5 +30,5 @@ int main() return 0; } -/* { dg-final { scan-tree-dump "y.._., points-to non-local, points-to escaped, points-to vars: { i }" "alias" } } */ +/* { dg-final { scan-tree-dump "y.._., points-to vars: { i }" "alias" } } */ /* { dg-final { cleanup-tree-dump "alias" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/pr45967.c b/gcc/testsuite/gcc.dg/torture/pr45967.c new file mode 100644 index 0000000..0a5b206 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr45967.c @@ -0,0 +1,21 @@ +/* { dg-do run } */ + +extern void abort (void); +void __attribute__((noinline,noclone)) +foo (void *p_) +{ + int *p; + int i; + for (i = 0; i < sizeof(int *); ++i) + ((char *)&p)[i] = ((char *)p_)[i]; + *p = 1; +} +int main() +{ + int i = 0; + int *p = &i; + foo (&p); + if (i != 1) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/torture/pta-escape-1.c b/gcc/testsuite/gcc.dg/torture/pta-escape-1.c index 3929d97..2aafe80 100644 --- a/gcc/testsuite/gcc.dg/torture/pta-escape-1.c +++ b/gcc/testsuite/gcc.dg/torture/pta-escape-1.c @@ -30,5 +30,5 @@ main() return 0; } -/* { dg-final { scan-tree-dump "ESCAPED = { ESCAPED NONLOCAL i }" "alias" } } */ +/* { dg-final { scan-tree-dump "ESCAPED = {\[^\n\}\]* i \[^\n\}\]*}" "alias" } } */ /* { dg-final { cleanup-tree-dump "alias" } } */ diff --git a/gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c b/gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c index 2a8dc9e..d41868e 100644 --- a/gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c +++ b/gcc/testsuite/gcc.dg/torture/pta-ptrarith-1.c @@ -29,5 +29,5 @@ int main() return 0; } -/* { dg-final { scan-tree-dump "ESCAPED = { ESCAPED NONLOCAL f .* i }" "alias" } } */ +/* { dg-final { scan-tree-dump "ESCAPED = {\[^\n\}\]* i f \[^\n\}\]*}" "alias" } } */ /* { dg-final { cleanup-tree-dump "alias" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c b/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c index add5c87..9c8ec30 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pta-callused.c @@ -22,6 +22,6 @@ int bar (int b) return *foo (&q); } -/* { dg-final { scan-tree-dump "CALLUSED = { f.* i q }" "alias" } } */ +/* { dg-final { scan-tree-dump "CALLUSED = { ESCAPED NONLOCAL f.* i q }" "alias" } } */ /* { dg-final { cleanup-tree-dump "alias" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-1.c index 50d7357..7cc19be 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-1.c @@ -33,5 +33,5 @@ int main() return 0; } -/* { dg-final { scan-tree-dump "ESCAPED, points-to non-local, points-to vars: { x }" "alias" } } */ +/* { dg-final { scan-tree-dump "ESCAPED, points-to non-local, points-to NULL, points-to vars: { x }" "alias" } } */ /* { dg-final { cleanup-tree-dump "alias" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-2.c index 226105e..878352d 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-2.c @@ -34,5 +34,5 @@ int main() return 0; } -/* { dg-final { scan-tree-dump "ESCAPED, points-to non-local, points-to vars: { x }" "alias" } } */ +/* { dg-final { scan-tree-dump "ESCAPED, points-to non-local, points-to NULL, points-to vars: { x }" "alias" } } */ /* { dg-final { cleanup-tree-dump "alias" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-3.c b/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-3.c index 15b06af..8e779d8 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pta-escape-3.c @@ -38,5 +38,5 @@ int main() return 0; } -/* { dg-final { scan-tree-dump "ESCAPED, points-to non-local, points-to vars: { x }" "alias" } } */ +/* { dg-final { scan-tree-dump "ESCAPED, points-to non-local, points-to NULL, points-to vars: { x }" "alias" } } */ /* { dg-final { cleanup-tree-dump "alias" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-21.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-21.c index 65a73d2..10efb12 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-21.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-21.c @@ -11,5 +11,5 @@ NumSift (long *array, unsigned long k) /* There should be only two loads left. */ -/* { dg-final { scan-tree-dump-times "= \\\*D" 2 "pre" } } */ +/* { dg-final { scan-tree-dump-times "= \\\*D\[^\n;\]*;" 2 "pre" } } */ /* { dg-final { cleanup-tree-dump "pre" } } */ |