Richard Biener wrote:

I also believe this loop is equivalent to checking TYPE_ALIGN of the aggregate 
type?

Jakub is correct: the intention is to discard any top-level alignment attribute on a struct declaration.

I'll double check your wording in the abi document, but it seems to be unclear 
whether packed and not packed structs should be passed the same (considering 
layout differences).  OTOH the above function is only relevant for register 
passing? (Likewise the abi document changes?)

It also affects the alignment of things passed on the stack. 'Packed' structs are affected too: the outer 'packed' will have no effect on the position on the stack / in registers, as you say; layout will still be packed.

Is this behavior correct for unions or aggregates with record or
union members?

To clarify Richard Earnshaw's statement: The intention is that 'member alignment' is pretty much gcc's TYPE_ALIGN (actually the source code type declaration - which is the same for for struct members, but ignoring cases where other opts like SRA figure out a larger TYPE_ALIGN). 'Natural alignment' is not directly available in GCC under all circumstances, hence having to compute it here.

--Alan

Reply via email to