From: Dan Klishch <daklishch@gmail.com>
To: gcc@gcc.gnu.org
Subject: Re: [[gcc_struct]] potential clang compatibility concerns
Date: Sat, 13 Jan 2024 12:12:49 -0500 [thread overview]
Message-ID: <CAAvxmfmq3VceZ-n0grdjc9+m9Lkp82MbBgxSB7=31RhK9zhoSQ@mail.gmail.com> (raw)
In-Reply-To: <CAAvxmfkRmqm884J21XN0fxPuCXB_0fPfhKBXdwDPagDEXPeehw@mail.gmail.com>
On Sat, Dec 2, 2023 at 4:50 PM Dan Klishch <daklishch@gmail.com> wrote:
>
> Hi,
>
> In the discussion of LLVM's PR adding `[[gnu::gcc_struct]]` support to Clang
> (https://github.com/llvm/llvm-project/pull/71148), maintainers asked
> me to make sure that whatever
> is done there, makes sense for GCC too.
>
> To summarize the long discussion on GitHub, GCC supports gcc_struct,
> ms_struct, and
> `-m{no-,}ms-bitfields` only on X86, while Clang currently supports ms_struct and
> `-m{no-,}ms-bitfields` on all targets with Itanium C++ ABI.
> Correspondingly, my PR adds support for
> gcc_struct for all targets with the Itanium C++ ABI and paves the road
> for gcc_struct and ms_struct
> support on targets with Microsoft C++ ABI (mainly,
> x86_64-pc-windows-msvc). There, I envision
> `ms_struct` to be a no-op (just like `gcc_struct` is usually a no-op
> with Itanium C++ ABI) and
> `gcc_struct` to change layout of C structs (or fields within C++
> classes) to be compatible with the
> GenericItanium C++ ABI.
>
> As far as I can tell, the maintainer's question is "in a theoretical
> event GCC starts supporting
> Microsoft C++ ABI, would it make sense to implement gcc_struct and
> ms_struct on it just like I
> propose to?".
Turns out that I wasn't quite right here about what John (@rjmccall)
asked. Quoting him: "Right, I'd just like to make sure that we're not
deepening a divergence here. It would be good to get agreement from
the GCC devs that they think ms_struct probably ought to do something
on e.g. ARM MinGW targets and that they consider this a bug (in a
feature that they may not really support, which is fine). But if they
think we're wrong and that this really should only have effect on x86,
I would like to know that". I hope ARM MinGW target for GCC is much
less far-fetched and I would actually get a reply from someone.
>
> Thanks,
> Dan Klishch
prev parent reply other threads:[~2024-01-13 17:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-02 21:50 Dan Klishch
2024-01-13 17:12 ` Dan Klishch [this message]
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='CAAvxmfmq3VceZ-n0grdjc9+m9Lkp82MbBgxSB7=31RhK9zhoSQ@mail.gmail.com' \
--to=daklishch@gmail.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).