This is the mail archive of the
mailing list for the GCC project.
Re: Aw: Re: asking for __attribute__((aligned()) clarification
On Tue, 20 Aug 2019, "Markus Fröschle" wrote:
> Thank you (and others) for your answers. Now I'm just as smart as before, however.
> Is it a supported, documented, 'long term' feature we can rely on or not?
> If yes, I would expect it to be properly documented. If not, never mind.
I think it's properly documented in gcc-9:
(the "old" behavior where the compiler would neither honor reduced alignment
nor issue a warning seems questionable, the new documentation promises a more
In portable code one can also use memcpy to move unaligned data, the compiler
should translate it like an unaligned load/store when size is a suitable
memcpy(&val, ptr, sizeof val);
(or __builtin_memcpy when -ffreestanding is in effect)