[LLVMbugs] [Bug 3414] New: missing x86-64 ABI alignment for arrays

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Jan 26 16:56:59 PST 2009


           Summary: missing x86-64 ABI alignment for arrays
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llvm-gcc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: gohman at apple.com
                CC: llvmbugs at cs.uiuc.edu

The x86-64 ABI states

"An array uses the same alignment as its elements, except that a local or
array variable of length at least 16 bytes or a C99 variable-length array
always has alignment of at least 16 bytes."

For the following testcase:

void frob(void *);

void foo(void) {
  char x[17];

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]

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