From: Florian Weimer <fweimer@redhat.com>
To: gcc@gcc.gnu.org
Subject: Minor C2X-induced ABI issue on powerpc64le
Date: Wed, 02 Mar 2022 16:03:11 +0100 [thread overview]
Message-ID: <8735k0jt1s.fsf@oldenburg.str.redhat.com> (raw)
I've been following
[RFC] Enabling -Wstrict-prototypes by default in C
<https://discourse.llvm.org/t/rfc-enabling-wstrict-prototypes-by-default-in-c/60521/25>
and I've just realized that treating
extern int foo();
as a prototype declaration (with the same ABI as extern "C" int foo();
in C++) introduces a minor ABI break if the caller is compiled in C2X
mode, but the definition is not. Without the prototype (C18 mode and
earlier), the caller needs to create a parameter save area per the
powerpc64le ABI. With the prototype (C2X mode), I would expect the
compiler to omit the parameter save area. Unfortunately, this creates
an ABI quirk if the C2X status doesn't match between caller and function
implementation.
I believe GCC uses the parameter save area for general-purpose spilling,
so it's still used in a prototype-less function definition without any
parameters. That's why this is a minor ABI break.
It's probably not much to worry about, but I'd like to point it out
nevertheless.
Thanks,
Florian
reply other threads:[~2022-03-02 15:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=8735k0jt1s.fsf@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=gcc@gcc.gnu.org \
/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).