public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Jakub Jelinek <jakub@redhat.com>,  <gcc@gcc.gnu.org>
Subject: Re: C89isms in the test suite
Date: Fri, 21 Oct 2022 23:52:22 +0200	[thread overview]
Message-ID: <87a65o7skp.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2210212057230.150427@digraph.polyomino.org.uk> (Joseph Myers's message of "Fri, 21 Oct 2022 21:00:03 +0000")

* Joseph Myers:

> On Fri, 21 Oct 2022, Florian Weimer via Gcc wrote:
>
>> Is this really possible?  For function pointers, it's an ABI change.
>> int (*) () and int (*) (void) have different calling conventions on some
>> ABIs (e.g., powerpc64le-linux-gnu).  The ABI difference goes away once
>> the callees are rebuilt, and I think such rebuilt callees are compatible
>> with either calling convention.
>
> The semantics of int (*) (void) are a refinement of those of pre-C2x 
> int (*) (): any non-variadic function whose argument types are unchanged 
> by the default argument promotions can be called through an int (*) () 
> pointer, but only functions with no arguments can be called through an 
> int (*) (void) pointer.

Pre-C2x powerpc64le-linux-gnu, a call through int (*) () with no
arguments still sets up a parameter save area, while a call through int
(*) (void) does not.  With C2x, neither will set up a parameter save
area.  Hopefully, the current rs6000 backend already uses the parameter
save area just for, well, saving parameters, and not for general-purpose
spilling.  In this case, there won't be any ABI problems from the C2x
change for powerpc64le.

(Sorry that I keep bringing this up, it's confusing to me, and I once
spent quite some time tracking down a stack corruption because glibc's
open implementation assumed a parameter save area that the caller did
not provide.)

Thanks,
Florian


  reply	other threads:[~2022-10-21 21:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21  8:40 Florian Weimer
2022-10-21  8:57 ` Jakub Jelinek
2022-10-21  9:17   ` Florian Weimer
2022-10-21  9:36     ` Jakub Jelinek
2022-10-21 10:01       ` Florian Weimer
2022-10-21 10:57         ` Florian Weimer
2022-10-21 21:00         ` Joseph Myers
2022-10-21 21:52           ` Florian Weimer [this message]
2022-10-21 20:57     ` Joseph Myers
2022-10-21 20:54 ` Joseph Myers
2022-10-21 21:46   ` Florian Weimer
2022-11-14  4:36 ` Sam James
2022-11-14  8:19   ` Florian Weimer
2022-11-15  5:05     ` Sam James
2022-11-21 11:12     ` Jakub Jelinek

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=87a65o7skp.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=joseph@codesourcery.com \
    /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).