From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86850 invoked by alias); 1 Jun 2015 13:50:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 86599 invoked by uid 89); 1 Jun 2015 13:50:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 01 Jun 2015 13:50:40 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D87BFAAF2 for ; Mon, 1 Jun 2015 13:50:36 +0000 (UTC) Date: Mon, 01 Jun 2015 13:50:00 -0000 From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix IPA-PTA for address-taken functions. Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2015-06/txt/msg00073.txt.bz2 Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2015-06-01 Richard Biener * 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" } } */