[LLVMbugs] [Bug 8871] New: incorrect alignment for struct containing double

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Dec 29 07:02:26 PST 2010


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

           Summary: incorrect alignment for struct containing double
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: pip88nl at gmail.com
                CC: llvmbugs at cs.uiuc.edu


On x86, the alignment requirement for `double' is 8 bytes and this is correctly
reported by __alignof. However, for a struct containing a double, __alignof
reports 4:

  struct hasdouble { double d; }; // alignment = 4

This is a problem on a system with alignment checking turned on. Note that it
correctly aligns the struct on x86_64. Also note that GCC has the same, in my
opinion incorrect, behaviour.

-- 
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