-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Closed
Labels
ABIApplication Binary InterfaceApplication Binary InterfacebugzillaIssues migrated from bugzillaIssues migrated from bugzillaobsoleteIssues with old (unsupported) versions of LLVMIssues with old (unsupported) versions of LLVM
Description
Bugzilla Link | 3414 |
Version | trunk |
OS | All |
Extended Description
The x86-64 ABI states
"An array uses the same alignment as its elements, except that a local or global
array variable of length at least 16 bytes or a C99 variable-length array variable
always has alignment of at least 16 bytes."
For the following testcase:
void frob(void *);
void foo(void) {
char x[17];
frob(x);
}
llvm-gcc -m64 emits
[...]
subq $32, $rsp
leaq -17(%rsp), %rdi
call frob
which shows that the array is not being aligned on a 16 byte boundary.
The LLVM IR has this:
%x = alloca [17 x 18]
Metadata
Metadata
Assignees
Labels
ABIApplication Binary InterfaceApplication Binary InterfacebugzillaIssues migrated from bugzillaIssues migrated from bugzillaobsoleteIssues with old (unsupported) versions of LLVMIssues with old (unsupported) versions of LLVM