Skip to content

Commit 510529f

Browse files
author
John Criswell
committed
Merged in Chris's fix from trunk (revision 1.138).
llvm-svn: 12508
1 parent df834c2 commit 510529f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

llvm/lib/Target/SparcV9/SparcV9InstrSelection.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,12 +1156,18 @@ CreateCodeForFixedSizeAlloca(const TargetMachine& target,
11561156
unsigned numElements,
11571157
std::vector<MachineInstr*>& getMvec)
11581158
{
1159-
assert(tsize > 0 && "Illegal (zero) type size for alloca");
11601159
assert(result && result->getParent() &&
11611160
"Result value is not part of a function?");
11621161
Function *F = result->getParent()->getParent();
11631162
MachineFunction &mcInfo = MachineFunction::get(F);
11641163

1164+
// If the alloca is of zero bytes (which is perfectly legal) we bump it up to
1165+
// one byte. This is unnecessary, but I really don't want to break any
1166+
// fragile logic in this code. FIXME.
1167+
if (tsize == 0)
1168+
tsize = 1;
1169+
1170+
11651171
// Put the variable in the dynamically sized area of the frame if either:
11661172
// (a) The offset is too large to use as an immediate in load/stores
11671173
// (check LDX because all load/stores have the same-size immed. field).

0 commit comments

Comments
 (0)