public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [[gcc_struct]] potential clang compatibility concerns
@ 2023-12-02 21:50 Dan Klishch
  2024-01-13 17:12 ` Dan Klishch
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Klishch @ 2023-12-02 21:50 UTC (permalink / raw)
  To: gcc

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [[gcc_struct]] potential clang compatibility concerns
  2023-12-02 21:50 [[gcc_struct]] potential clang compatibility concerns Dan Klishch
@ 2024-01-13 17:12 ` Dan Klishch
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Klishch @ 2024-01-13 17:12 UTC (permalink / raw)
  To: gcc

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-13 17:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-02 21:50 [[gcc_struct]] potential clang compatibility concerns Dan Klishch
2024-01-13 17:12 ` Dan Klishch

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).