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)?

Andrew Haley aph@redhat.com
Sun Dec 30 12:52:00 GMT 2018


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. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the Gcc-help mailing list