From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70836 invoked by alias); 2 Aug 2017 09:47:38 -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 70808 invoked by uid 89); 2 Aug 2017 09:47:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy= 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; Wed, 02 Aug 2017 09:47:35 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 24AEC54936C; Wed, 2 Aug 2017 11:47:33 +0200 (CEST) Date: Wed, 02 Aug 2017 09:47:00 -0000 From: Jan Hubicka To: Yuri Gribov Cc: GCC Patches Subject: Re: [PATCHv2][PING^2][PR 56727] Bypass PLT for recursive calls Message-ID: <20170802094732.GC98370@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-08/txt/msg00151.txt.bz2 Hi, > On Mon, Jul 17, 2017 at 10:27 AM, Jan Hubicka wrote: > >> Hi all, > >> > >> This is a new version of previous patch > >> (https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00020.html), fixed > >> after Rainer's remarks. > > Hi, > > the patch looks OK, but I wonder why you included can_be_discarded check? > > If function is in comdat I believe the optimization still can happen. > > Perhaps you only want to check DECL_EXTERNAL? > > TBH I was inspired by can_replace_by_local_alias which prohibits local > alias for discardable functions. But I agree that situation here is > different and it's indeed not needed (if function is discarded, it > does not matter whether we optimized recursive calls). > > Could you elaborate why we still need DECL_EXTERNAL though? I you have DECL_EXTERNAl function, its definition lives only until inlining and then all offline copies are replaced by external calls. So if you create alias for recusive call you will probably end up with an ICE. Honza > > -Y