From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36822 invoked by alias); 24 Jul 2017 14:06:29 -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 36771 invoked by uid 89); 24 Jul 2017 14:06:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:2530 X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Jul 2017 14:06:25 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id A422A5487F2; Mon, 24 Jul 2017 16:06:22 +0200 (CEST) Date: Mon, 24 Jul 2017 14:06:00 -0000 From: Jan Hubicka To: Martin =?iso-8859-2?Q?Li=B9ka?= Cc: Yuri Gribov , GCC Patches Subject: Re: [PATCH] Fix wrong condition in ipa-visibility.c (PR ipa/81520). Message-ID: <20170724140622.GB90943@kam.mff.cuni.cz> References: <20170717092719.GB33905@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2017-07/txt/msg01430.txt.bz2 > >From 046931ec490d20a6c003094367f7f0bfae64647f Mon Sep 17 00:00:00 2001 > From: marxin > Date: Mon, 24 Jul 2017 11:21:18 +0200 > Subject: [PATCH] Fix wrong condition in ipa-visibility.c (PR ipa/81520). > > gcc/ChangeLog: > > 2017-07-24 Martin Liska > > PR ipa/81520 > * ipa-visibility.c (function_and_variable_visibility): Make the redirection > just on target that do supporting aliasing. Fix GNU coding style. > > gcc/testsuite/ChangeLog: > > 2017-07-24 Martin Liska > > PR ipa/81520 > * gcc.dg/ipa/pr81520.c: New test. OK, we probably should turn ASM_OUTPUT_DEF ifdefs into a conditional compilation incrementally. Thanks, Honza > --- > gcc/ipa-visibility.c | 11 +++++++---- > gcc/testsuite/gcc.dg/ipa/pr81520.c | 11 +++++++++++ > 2 files changed, 18 insertions(+), 4 deletions(-) > create mode 100644 gcc/testsuite/gcc.dg/ipa/pr81520.c > > diff --git a/gcc/ipa-visibility.c b/gcc/ipa-visibility.c > index 21321703dbb..13cf2a3a1cf 100644 > --- a/gcc/ipa-visibility.c > +++ b/gcc/ipa-visibility.c > @@ -615,9 +615,10 @@ function_and_variable_visibility (bool whole_program) > struct cgraph_node *node; > varpool_node *vnode; > > - /* All aliases should be procssed at this point. */ > + /* All aliases should be processed at this point. */ > gcc_checking_assert (!alias_pairs || !alias_pairs->length ()); > > +#ifdef ASM_OUTPUT_DEF > FOR_EACH_DEFINED_FUNCTION (node) > { > if (node->get_availability () != AVAIL_INTERPOSABLE > @@ -634,20 +635,22 @@ function_and_variable_visibility (bool whole_program) > continue; > > if (!alias) > - { > + { > alias = dyn_cast (node->noninterposable_alias ()); > gcc_assert (alias && alias != node); > } > > e->redirect_callee (alias); > if (gimple_has_body_p (e->caller->decl)) > - { > + { > push_cfun (DECL_STRUCT_FUNCTION (e->caller->decl)); > e->redirect_call_stmt_to_callee (); > - pop_cfun (); > + pop_cfun (); > } > } > } > +#endif > + > FOR_EACH_FUNCTION (node) > { > int flags = flags_from_decl_or_type (node->decl); > diff --git a/gcc/testsuite/gcc.dg/ipa/pr81520.c b/gcc/testsuite/gcc.dg/ipa/pr81520.c > new file mode 100644 > index 00000000000..b5d33d2dc96 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/ipa/pr81520.c > @@ -0,0 +1,11 @@ > +/* PR ipa/81520 */ > +/* { dg-do compile } */ > +/* { dg-options "-O2 -fPIC" } */ > +/* { dg-require-effective-target fpic } */ > + > +char > +a (int b) > +{ > + a (b); > + return 0; > +} > -- > 2.13.3 >