[LLVMbugs] [Bug 7552] New: Alignment on loads with __attribute__((packed))

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 1 14:28:47 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7552

           Summary: Alignment on loads with __attribute__((packed))
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: arplynn at gmail.com
                CC: llvmbugs at cs.uiuc.edu


When emitting loads from __attribute__((packed)) structs, clang will happily
tell LLVM to use the natural alignment of the type. This is wrong - it should
work out the alignment for the struct, or at least use align 1.


Test case:

struct foo {
char a;
int b;
} __attribute__((packed));

int bees(struct foo* bar) { return bar->b; }

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list