public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Michael Meissner <meissner@linux.ibm.com>,
	Nathan Sidwell <nathan@acm.org>,
	GCC Development <gcc@gcc.gnu.org>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	 "Kewen.Lin" <linkw@linux.ibm.com>,
	David Edelsohn <dje.gcc@gmail.com>,
	 Peter Bergner <bergner@linux.ibm.com>,
	Will Schmidt <will_schmidt@vnet.ibm.com>,
	Jason Merrill <jason@redhat.com>,
	Mike Stump <mikestump@comcast.net>,
	 Iain Sandoe <iain@sandoe.co.uk>,
	Joseph Myers <joseph@codesourcery.com>,
	 Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>,
	Alan Modra <amodra@gmail.com>, Nick Clifton <nickc@redhat.com>,
	 Jeff Law <jlaw@tachyum.com>, Jakub Jelinek <jakub@redhat.com>,
	Richard Biener <rguenther@suse.de>,
	 "David S. Miller" <davem@redhat.com>,
	"Carlos O'Donell" <carlos@redhat.com>,
	 GNU C Library <libc-alpha@sourceware.org>
Subject: Re: Potential upcoming changes in mangling to PowerPC GCC
Date: Thu, 4 Aug 2022 22:14:10 +0100	[thread overview]
Message-ID: <CAH6eHdR8FAnRP4CvDtHHqo3DSk2JrpLUbR3ueHMQPK-Mb35zJg@mail.gmail.com> (raw)
In-Reply-To: <YuwIqy6LxB1KlHLr@toto.the-meissners.org>

On Thu, 4 Aug 2022 at 18:58, Michael Meissner via Gcc <gcc@gcc.gnu.org> wrote:
>
> On Thu, Aug 04, 2022 at 10:49:24AM +0200, Nathan Sidwell wrote:
> > Not a problem. I don't think I have anything to add- I presume you've
> > thought about (weak) aliases to deal with the problematic changes you
> > mention towards the end?
>
> I've thought about it.  I know in the past we had weak aliases to do the
> support the same way when we had the last name mangling change.  I know those
> aliases weren't popular back then.
>
> Part of the reason for asking is I don't have a sense for how library
> maintainers use the __float128 and __ibm128 keywords.  Do they treat them as
> full fledged types, or are they just convenient ways to compile code with both
> names rather than building two modules, with the different long double types?


Within libstdc++ it's not just a minor convenience, it's 100%
necessary to refer to both kinds (IEEE 128 and IBM 128) in the same
translation unit. There are C++ classes with member functions taking
both types, e.g.

struct Foo {
  void f(__ibm128);
  void f(__ieee128);
};

You can't do this by "building two modules" because it's a header and
you can't split the definition of a class across two different files.
And in many cases, it's a class template, so you can't even hide the
definition of the function in a .cc file, it has to be defined in the
header. So libstdc++ 100% requires a way to refer to "the type that is
long double" (which is easy, that's 'long double') and "the other
128-bit type that isn't long double" (which is one of __ibm128 or
__ieee128). So we need to refer to *at least* one of __ibm128 or
__ieee128, and in some cases it's simpler to not refer to 'long
double' at all (because its meaning can change) and just refer to
__ibm128 and __ieee128 because those always mean the same thing.

If the names or mangling for either of those types changes, it would
break libstdc++ and require more work just to restore the existing
functionality.

  reply	other threads:[~2022-08-04 21:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-03 22:21 Michael Meissner
     [not found] ` <CAAJqyv4_RQ=di2WcDN+n0j4rWQQNtcnaT_6MkyFHie9oDQY1bg@mail.gmail.com>
2022-08-04 17:58   ` Michael Meissner
2022-08-04 21:14     ` Jonathan Wakely [this message]
2022-08-08 21:35       ` Michael Meissner

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=CAH6eHdR8FAnRP4CvDtHHqo3DSk2JrpLUbR3ueHMQPK-Mb35zJg@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=amodra@gmail.com \
    --cc=bergner@linux.ibm.com \
    --cc=carlos@redhat.com \
    --cc=davem@redhat.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=iain@sandoe.co.uk \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.com \
    --cc=jlaw@tachyum.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linkw@linux.ibm.com \
    --cc=meissner@linux.ibm.com \
    --cc=mikestump@comcast.net \
    --cc=nathan@acm.org \
    --cc=nickc@redhat.com \
    --cc=rguenther@suse.de \
    --cc=segher@kernel.crashing.org \
    --cc=tuliom@linux.ibm.com \
    --cc=will_schmidt@vnet.ibm.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).