* [PATCH] Fix IPA-PTA for address-taken functions.
@ 2015-06-01 13:50 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2015-06-01 13:50 UTC (permalink / raw)
To: gcc-patches
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2015-06-01 Richard Biener <rguenther@suse.de>
* tree-ssa-structalias.c (ipa_pta_execute): Handle address-taken
functions.
* gcc.dg/ipa/ipa-pta-1.c: Adjust.
Index: gcc/tree-ssa-structalias.c
===================================================================
--- gcc/tree-ssa-structalias.c (revision 223918)
+++ gcc/tree-ssa-structalias.c (working copy)
@@ -7372,7 +7372,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);
Index: gcc/testsuite/gcc.dg/ipa/ipa-pta-1.c
===================================================================
--- gcc/testsuite/gcc.dg/ipa/ipa-pta-1.c (revision 223918)
+++ gcc/testsuite/gcc.dg/ipa/ipa-pta-1.c (working copy)
@@ -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" } } */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-06-01 13:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-01 13:50 [PATCH] Fix IPA-PTA for address-taken functions Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).