public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dan Klishch <daklishch@gmail.com>
To: gcc@gcc.gnu.org
Subject: [[gcc_struct]] potential clang compatibility concerns
Date: Sat, 2 Dec 2023 16:50:57 -0500	[thread overview]
Message-ID: <CAAvxmfkRmqm884J21XN0fxPuCXB_0fPfhKBXdwDPagDEXPeehw@mail.gmail.com> (raw)

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?".

Thanks,
Dan Klishch

             reply	other threads:[~2023-12-02 21:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-02 21:50 Dan Klishch [this message]
2024-01-13 17:12 ` Dan Klishch

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=CAAvxmfkRmqm884J21XN0fxPuCXB_0fPfhKBXdwDPagDEXPeehw@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).