-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Win64 Does not codegen correctly alloca align 64 #9294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am planning to eliminate the block you attempt to patch. See also; Improved output is below; factorial: |
This looks right. |
It would be suboptimal. We may do; subq $4, %rsp ; or -8 It seems x86-codegen-generic issue. I will file one. Anyway, I will add Zvi's testcase. |
It has been fixed in r124949. |
mentioned in issue llvm/llvm-bugzilla-archive#9100 |
[lldb] Add test with custom alignment on a clang type
Extended Description
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.
The text was updated successfully, but these errors were encountered: