From 4b1db7666b5458ea0099755b5b43b91d688e8540 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 1 Jun 2015 13:51:20 +0000 Subject: [PATCH] tree-ssa-structalias.c (ipa_pta_execute): Handle address-taken functions. 2015-06-01 Richard Biener * tree-ssa-structalias.c (ipa_pta_execute): Handle address-taken functions. * gcc.dg/ipa/ipa-pta-1.c: Adjust. From-SVN: r223977 --- gcc/ChangeLog | 5 +++++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/ipa/ipa-pta-1.c | 13 ++++++++----- gcc/tree-ssa-structalias.c | 3 ++- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9e18b50b23e..28cfe8bca61 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-06-01 Richard Biener + + * tree-ssa-structalias.c (ipa_pta_execute): Handle address-taken + functions. + 2015-06-01 Martin Liska * alloc-pool.h: Add ATTRIBUTE_UNUSED for diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0590f02a093..d74d29d8e66 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-06-01 Richard Biener + + * gcc.dg/ipa/ipa-pta-1.c: Adjust. + 2015-06-01 Jakub Jelinek * gcc.target/s390/hotpatch-compile-15.c: Remove dg-prune-output diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-pta-1.c b/gcc/testsuite/gcc.dg/ipa/ipa-pta-1.c index 234f2b8a192..c183fcb641c 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-pta-1.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-pta-1.c @@ -40,10 +40,13 @@ int main() } /* IPA PTA needs to handle indirect calls properly. Verify that - both bar and foo get a (and only a) in their arguments points-to sets. */ + both bar and foo get a (and only a) in their arguments points-to sets. + ??? As bar and foo have their address taken there might be callers + not seen by IPA PTA (if the address escapes the unit which we only compute + during IPA PTA...). Thus the solution also includes NONLOCAL. */ /* { dg-final { scan-ipa-dump "fn_1 = { bar foo }" "pta" } } */ -/* { dg-final { scan-ipa-dump "bar.arg0 = { a }" "pta" } } */ -/* { dg-final { scan-ipa-dump "bar.arg1 = { a }" "pta" } } */ -/* { dg-final { scan-ipa-dump "foo.arg0 = { a }" "pta" } } */ -/* { dg-final { scan-ipa-dump "foo.arg1 = { a }" "pta" } } */ +/* { dg-final { scan-ipa-dump "bar.arg0 = { NONLOCAL a }" "pta" } } */ +/* { dg-final { scan-ipa-dump "bar.arg1 = { NONLOCAL a }" "pta" } } */ +/* { dg-final { scan-ipa-dump "foo.arg0 = { NONLOCAL a }" "pta" } } */ +/* { dg-final { scan-ipa-dump "foo.arg1 = { NONLOCAL a }" "pta" } } */ diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index e802d78367b..0cd881236f0 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -7369,7 +7369,8 @@ ipa_pta_execute (void) constraints for parameters. */ if (node->used_from_other_partition || node->externally_visible - || node->force_output) + || node->force_output + || node->address_taken) { intra_create_variable_infos (func); -- 2.30.2