[Bug target/92287] Mismatches in the calling convention for zero sized types
segher at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Oct 31 00:19:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92287
Segher Boessenkool <segher at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |segher at gcc dot gnu.org
--- Comment #6 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Bill Schmidt from comment #5)
> For the 32-bit ELF ABI, all structs (regardless of size) are passed using a
> pointer allowing for call-by-value semantics. This is the source of ZSTs
> requiring a register. So it's clear there is an ABI that requires this
> behavior. (Look for the Parameter Passing Register Selection Algorithm in
> https://github.com/ryanarn/powerabi/blob/master/chap3-elf32abi.sgml.)
>
> The 64-bit ABIs (both ELF V1 and ELF V2) pass structures in registers, and
> the parameter passing algorithms won't assign registers for size-0
> aggregates. This is intentional.
Yup. And everything is identical between LE and BE on all these ABIs.
Note that the situation for zero-sized structs isn't very clear in
most ABIs, these included. You must have an unusual program if this
ever matters ;-)
More information about the Gcc-bugs
mailing list