https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96293

--- Comment #10 from lavr at ncbi dot nlm.nih.gov ---
> In your code, `&a->record.data[0]` is not a well-aligned access

It is well-aligned, its offset gets printed out by the very test code, and it's
2.

> because `struct attribute` is defined as packed, so compiler has no any
> information about where `a` itself is aligned to.

Are you kidding me?  "a" is an automatic object on stack, which compiler itself
allocates.  So it is well-aligned, for sure.

Even if "a" was coming as an argument of a function call (via a pointer), the
compiler should assume it's aligned, because it always does for any other
regular structures.

Reply via email to