llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.84k stars 11.47k forks source link

Zero-size byval argument crashes AArch64 isel #32644

Open llvmbot opened 7 years ago

llvmbot commented 7 years ago
Bugzilla Link 33297
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @john-brawn-arm

Extended Description

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.

john-brawn-arm commented 3 years ago

Still asserts in current trunk.