mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-16 16:31:04 +00:00
Fix crash with varargs function with no named parameters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136623 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
32ab312e3f
commit
965b891762
@ -1148,10 +1148,10 @@ XCoreTargetLowering::LowerCCCArguments(SDValue Chain,
|
||||
int offset = 0;
|
||||
// Save remaining registers, storing higher register numbers at a higher
|
||||
// address
|
||||
for (unsigned i = array_lengthof(ArgRegs) - 1; i >= FirstVAReg; --i) {
|
||||
for (int i = array_lengthof(ArgRegs) - 1; i >= (int)FirstVAReg; --i) {
|
||||
// Create a stack slot
|
||||
int FI = MFI->CreateFixedObject(4, offset, true);
|
||||
if (i == FirstVAReg) {
|
||||
if (i == (int)FirstVAReg) {
|
||||
XFI->setVarArgsFrameIndex(FI);
|
||||
}
|
||||
offset -= StackSlotSize;
|
||||
|
17
test/CodeGen/XCore/2011-08-01-VarargsBug.ll
Normal file
17
test/CodeGen/XCore/2011-08-01-VarargsBug.ll
Normal file
@ -0,0 +1,17 @@
|
||||
; RUN: llc < %s -march=xcore | FileCheck %s
|
||||
define void @_Z1fz(...) {
|
||||
entry:
|
||||
; CHECK: _Z1fz:
|
||||
; CHECK: extsp 3
|
||||
; CHECK: stw r[[REG:[0-3]{1,1}]]
|
||||
; CHECK: , sp{{\[}}[[REG]]{{\]}}
|
||||
; CHECK: stw r[[REG:[0-3]{1,1}]]
|
||||
; CHECK: , sp{{\[}}[[REG]]{{\]}}
|
||||
; CHECK: stw r[[REG:[0-3]{1,1}]]
|
||||
; CHECK: , sp{{\[}}[[REG]]{{\]}}
|
||||
; CHECK: stw r[[REG:[0-3]{1,1}]]
|
||||
; CHECK: , sp{{\[}}[[REG]]{{\]}}
|
||||
; CHECK: ldaw sp, sp[3]
|
||||
; CHECK: retsp 0
|
||||
ret void
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user