This is the mail archive of the
mailing list for the GCC project.
Re: GCC libatomic ABI specification draft
- From: Michael Matz <matz at suse dot de>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Torvald Riegel <triegel at redhat dot com>, Bin Fan <bin dot x dot fan at oracle dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 23 Jan 2017 15:00:08 +0100 (CET)
- Subject: Re: GCC libatomic ABI specification draft
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <alpine.LSU.email@example.com> <firstname.lastname@example.org>
On Fri, 20 Jan 2017, Richard Henderson wrote:
> > You can't have a 4-aligned type of size 3. Sizes must be multiples of
> > alignment (otherwise arrays don't work). The type of a 3-sized field
> > in a packed struct that syntactically might be a 4-aligned type (e.g.
> > by using attributes on char-array types) is actually a different type
> > having an alignment of 1. It's easier to simply regard all types
> > inside packed structs as 1-aligned (which is IMO what we try to do).
> > That is, the byte after a 4-aligned "3-sized" type is always padding.
> [ I read Bin Fan's original email some months ago, but I don't have it handy
> now. Take faulty memory with a grain of salt. ]
> I thought this was about libatomic being presented with an unaligned 3-byte
> structure that happens to sit within an aligned 4-byte word, and choosing to
> atomically operate on the 4-byte word instead of taking a lock on the side.
Ah well, in that case I lost context as well ;)