mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
Fix fastcc structure return with fast-isel on x86-32
On x86-32, structure return via sret lets the callee pop the hidden pointer argument off the stack, which the caller then re-pushes. However if the calling convention is fastcc, then a register is used instead, and the caller should not adjust the stack. This is implemented with a check of IsTailCallConvention X86TargetLowering::LowerCall but is now checked properly in X86FastISel::DoSelectCall. (this time, actually commit what was reviewed!) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155825 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -46,3 +46,17 @@ entry:
|
||||
; CHECK: addl $40
|
||||
}
|
||||
declare void @test3sret(%struct.a* sret)
|
||||
|
||||
; Check that fast-isel sret works with fastcc (and does not callee-pop)
|
||||
define void @test4() nounwind ssp {
|
||||
entry:
|
||||
%tmp = alloca %struct.a, align 8
|
||||
call fastcc void @test4fastccsret(%struct.a* sret %tmp)
|
||||
ret void
|
||||
; CHECK: test4:
|
||||
; CHECK: subl $28
|
||||
; CHECK: leal (%esp), %ecx
|
||||
; CHECK: calll _test4fastccsret
|
||||
; CHECK addl $28
|
||||
}
|
||||
declare fastcc void @test4fastccsret(%struct.a* sret)
|
||||
|
||||
Reference in New Issue
Block a user