[LLVMdev] Proposed: first class packed structures

Andrew Lenharth andrewl at lenharth.org
Fri Dec 8 06:15:38 PST 2006


On 12/8/06, Chris Lattner <clattner at apple.com> wrote:
> <gcc.patch>
>
> This patch isn't sufficient for two reasons: 1) it will turn structs that
> don't need to be packed into packed llvm structs.  2) it won't turn some
> that should be packed llvm structs into packed structs (e.g. strange ABI
> considerations force a field to be unaligned, not an attribute at the source
> level).

Yea, I've also come across a case:
struct { short x __attribute((packed)); int y __attribute((packed)); }
a = {1, 2}, b = ... ;
That my patch doesn't handle;

> Seem reasonable?

Yea, having tried the logic on larger codes (aka the linux kernel)
I've found more packed idioms I wasn't handling.  I'll see what I can
do.

Andrew



More information about the llvm-dev mailing list