From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69106 invoked by alias); 15 May 2015 16:27:59 -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 68670 invoked by uid 89); 15 May 2015 16:27:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: smtp.ispras.ru Received: from smtp.ispras.ru (HELO smtp.ispras.ru) (83.149.199.79) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 May 2015 16:27:57 +0000 Received: from [10.10.3.121] (unknown [83.149.199.91]) by smtp.ispras.ru (Postfix) with ESMTP id 4EF27214F2; Fri, 15 May 2015 19:27:52 +0300 (MSK) Date: Fri, 15 May 2015 16:37:00 -0000 From: Alexander Monakov To: gcc-patches@gcc.gnu.org cc: Rich Felker , Jan Hubicka , Uros Bizjak Subject: Re: [PATCH i386] Allow sibcalls in no-PLT PIC In-Reply-To: <1430757479-14241-5-git-send-email-amonakov@ispras.ru> Message-ID: References: <1430757479-14241-1-git-send-email-amonakov@ispras.ru> <1430757479-14241-5-git-send-email-amonakov@ispras.ru> User-Agent: Alpine 2.11 (LNX 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2015-05/txt/msg01429.txt.bz2 Ping? Any comment about this patch? On Mon, 4 May 2015, Alexander Monakov wrote: > With -fno-plt, we don't have to reject even direct calls as sibcall > candidates. > > This patch depends on '-fplt' flag that is introduced in another patch. > > This patch requires that with -fno-plt all sibcall candidates go through > prepare_call_address that transforms the call to a GOT lookup. > > OK? > * config/i386/i386.c (ix86_function_ok_for_sibcall): Check flag_plt. > > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c > index f29e053..b734350 100644 > --- a/gcc/config/i386/i386.c > +++ b/gcc/config/i386/i386.c > @@ -5448,12 +5448,13 @@ ix86_function_ok_for_sibcall (tree decl, tree exp) > /* If we are generating position-independent code, we cannot sibcall > optimize any indirect call, or a direct call to a global function, > as the PLT requires %ebx be live. (Darwin does not have a PLT.) */ > if (!TARGET_MACHO > && !TARGET_64BIT > && flag_pic > + && flag_plt > && (decl && !targetm.binds_local_p (decl))) > return false; > > /* If we need to align the outgoing stack, then sibcalling would > unalign the stack, which may break the called function. */ > if (ix86_minimum_incoming_stack_boundary (true) >