From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126846 invoked by alias); 30 Dec 2018 11:30:42 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 126808 invoked by uid 89); 30 Dec 2018 11:30:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 30 Dec 2018 11:30:38 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C1A487633; Sun, 30 Dec 2018 11:30:37 +0000 (UTC) Received: from zebedee.pink (ovpn-126-138.rdu2.redhat.com [10.10.126.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C8815D736; Sun, 30 Dec 2018 11:30:36 +0000 (UTC) Subject: Re: Which spec has defined the calling sequence of static C functions (like the extern C functions' has been defined in the Sys V ABI specs)? To: Xi Ruoyao , Remus Clearwater Cc: gcc-help@gcc.gnu.org References: <3a5716b0b40ec55097347012a3b800d9f23987b4.camel@mengyan1223.wang> From: Andrew Haley Openpgp: preference=signencrypt Message-ID: <156c48e1-88da-1f82-b5a9-bf176a435a57@redhat.com> Date: Sun, 30 Dec 2018 12:52:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <3a5716b0b40ec55097347012a3b800d9f23987b4.camel@mengyan1223.wang> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00091.txt.bz2 On 12/30/18 10:43 AM, Xi Ruoyao wrote: > On 2018-12-30 17:58 +0800, Remus Clearwater wrote: >> For the "calling" of the C static functions, it has only two >> possibilities -- either it's been inlined by the compiler optimization >> (i.e. not actually been called by the `call` instruction but been optimized >> for the reason of speed), Or it would be actually called (with the `call` >> instruction) under the "Function Calling Sequence" constraints which have >> been described in the Sys V ABI specs (same as the calling of those extern >> C functions). > > No. The compiler may use customized calling convention to maximize the > performance unless this function may be called in other translation units. That's exactly right. We can do anything we want inside a translation unit as long as we provide standard interfaces to everything reachable from outside the translation unit. -- Andrew Haley Java Platform Lead Engineer Red Hat UK Ltd. EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671