[LLVMbugs] [Bug 8922] New: Win64 Does not codegen correctly alloca align 64

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jan 6 07:43:45 PST 2011


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

           Summary: Win64 Does not codegen correctly alloca align 64
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: zvi.rackover at intel.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=5971)
 --> (http://llvm.org/bugs/attachment.cgi?id=5971)
Reproducer test

The following test case produces the assertion below when running on the Win64
subtarget:

define noalias i32* @factorial() nounwind readnone {
entry:
  %a = alloca i32, align 64
  ret i32* %a
}

Assertion failed: (-(Offset + StackSize)) % Align == 0, file
..\..\..\..\lib\Target\X86\X86FrameInfo.cpp, line 867

Explanation:

Win64 CodeGen adds an extra 32 bytes to frame size, to be used as a Red Zone
for potential calls. This addition ruins the stack alignment in case the
required alignment is greater than 32 bytes. 

Proposed fix is to add max(32, MaxAlignment) bytes instead.
Attached are the testcase and patch.

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