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

--- Comment #7 from Sergey Kaplun <sergey_v_kaplun at mail dot ru> ---
(In reply to Drea Pinski from comment #1)
> It might also be what the x86_64 abi says should happen.
> Do you have a reference there?
I can't find the precise mentioning of zero-sized fields in the ABI
description.

According to the description of the classification of aggregate [1]:
| Each field of an object is classified recursively so that always
| two fields \footnote{Zero-width bit-fields are NO_CLASS.} are
| considered.  The resulting class is calculated
| according to the classes of the fields in the eightbyte:

So it may be interpreted as the subarray sizes should be taken into account.

OTOH, I see no contradictions with the first statement:
| If the size of an object is larger than eight eightbytes, or it contains
unaligned fields, it has class MEMORY

And also NO_CLASS is defined as the following:
| NO_CLASS This class is used as initializer in the algorithms. It will be used
| for padding and empty structures and unions

Which looks applicable for this case.

Side note: I've sent the draft version of the patch [2] in the ML. I don't
know: should I mention it here somehow?

[1]:
https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/e1ce098331da5dbd66e1ffc74162380bcc213236/x86-64-ABI/low-level-sys-info.tex#L662-665
[2]: https://gcc.gnu.org/pipermail/gcc-patches/2026-April/714864.html

Reply via email to