[LLVMbugs] [Bug 12148] New: alignment (via attribute) of base class ignored
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Thu Mar 1 01:42:46 PST 2012
http://llvm.org/bugs/show_bug.cgi?id=12148
Bug #: 12148
Summary: alignment (via attribute) of base class ignored
Product: clang
Version: 3.0
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: kretz at kde.org
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
The following testcase does not work as expected (can't argue with a standard
other than GCC behavior here):
struct AlignedBase {
} __attribute__((aligned(16)));
struct A : public AlignedBase {
int data[16];
};
void *foo()
{
A a;
return &a.data[0];
}
GCC will ensure that A is aligned to 16 Bytes. With clang I get the following:
0000000000000000 <foo()>:
0: 48 8d 44 24 c0 lea -0x40(%rsp),%rax
5: c3 retq
Since %rsp is a multiple of 16 + 8 on x86_64 this code would be incorrect.
--
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