From: Remus Clearwater <remus.clearwater@gmail.com>
To: Xi Ruoyao <xry111@mengyan1223.wang>
Cc: Andrew Haley <aph@redhat.com>, gcc-help@gcc.gnu.org
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)?
Date: Sun, 30 Dec 2018 13:27:00 -0000 [thread overview]
Message-ID: <CAMjELSvfXrm4=xJYSKP31RBjWn-t8oEmfoKmzO113vCbffj_jA@mail.gmail.com> (raw)
In-Reply-To: <3a5716b0b40ec55097347012a3b800d9f23987b4.camel@mengyan1223.wang>
>
> > Furthermore, could I make the following conclusion under GCC and Linux?
> > Conclusion:
> >
> > 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.
>
Thank you very much, Xi. This information is very useful to me. Because I
have never known the existence of such kind optimization before. It is
brilliant! Do you mind to provide an example about such optimization --
"customized calling convention about the calling of some static functions"
in GCC?
Thanks a lot :-)
next prev parent reply other threads:[~2018-12-30 13:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-29 18:52 Remus Clearwater
2018-12-30 9:58 ` Andrew Haley
2018-12-30 10:43 ` Remus Clearwater
2018-12-30 11:30 ` Xi Ruoyao
2018-12-30 12:52 ` Andrew Haley
2018-12-30 13:21 ` Remus Clearwater
2018-12-31 10:49 ` Remus Clearwater
2018-12-30 13:27 ` Remus Clearwater [this message]
2019-01-03 13:46 ` Florian Weimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMjELSvfXrm4=xJYSKP31RBjWn-t8oEmfoKmzO113vCbffj_jA@mail.gmail.com' \
--to=remus.clearwater@gmail.com \
--cc=aph@redhat.com \
--cc=gcc-help@gcc.gnu.org \
--cc=xry111@mengyan1223.wang \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).