[LLVMbugs] [Bug 18264] New: [-cxx-abi microsoft] Bad size calculation for struct hierarchy involving pack and alignment

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Dec 16 16:55:15 PST 2013


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

            Bug ID: 18264
           Summary: [-cxx-abi microsoft] Bad size calculation for struct
                    hierarchy involving pack and alignment
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

consider:
extern "C" int printf(const char *fmt, ...);
struct __declspec(align(4096)) C0 {
  __declspec(align(2)) float C0F2;
  C0() {}
};
#pragma pack(push, 1)
struct C1 : public C0 {
  C1() {}
};
#pragma pack(pop)
struct C2 : public C1 {
  char C2F2;
  C2() {}
};
int main() { printf("sizeof(%s): %Iu\n", "C2", sizeof(C2)); }

we get:
sizeof(C2): 8192

we want:
sizeof(C2): 4096

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131217/3b0f7f58/attachment.html>


More information about the llvm-bugs mailing list