Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Zero-size byval argument crashes AArch64 isel #32269

Open Quuxplusone opened 7 years ago

Quuxplusone commented 7 years ago
Bugzilla Link PR33297
Status CONFIRMED
Importance P normal
Reported by David Nadlinger (code@klickverbot.at)
Reported on 2017-06-03 16:04:11 -0700
Last modified on 2020-09-17 06:13:41 -0700
Version trunk
Hardware PC All
CC john.brawn@arm.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also

This hits an assert in LLVM 4.0 (also seems to be present in trunk):


target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" target triple = "aarch64-unknown-linux-gnu"

define i32 @foo([0 x i32]* byval align 4 %bar) { ret i32 0 }

llc: /build/src/llvm/lib/CodeGen/MachineFunction.cpp:824: int llvm::MachineFrameInfo::CreateFixedObject(uint64_t, int64_t, bool, bool): Assertion `Size != 0 && "Cannot allocate zero size fixed stack objects!"' failed.
#0 0x0000000000ea4378 (llc+0xea4378)
Stack dump:
0.      Program arguments: llc test.ll
1.      Running pass 'Function Pass Manager' on module 'test.ll'.
2.      Running pass 'AArch64 Instruction Selection' on function '@foo'
Aborted

While the code is not very useful, the backend probably shouldn't assert.

Quuxplusone commented 4 years ago

Still asserts in current trunk.