| Issue |
124519
|
| Summary |
[Flang][AArch64] Assertion `Size != 0 && "Cannot allocate zero size fixed stack objects!"' failed.
|
| Labels |
flang
|
| Assignees |
|
| Reporter |
k-arrows
|
I can reproduce this crash on aarch64, but not on x86_64.
Reproducer:
```f90
function f(x) bind(c)
type, bind(c) :: t
end type
type(t) :: x
value :: x
end
end
```
Assertion failure:
```txt
flang: /opt/llvm-project/llvm/lib/CodeGen/MachineFrameInfo.cpp:85: int llvm::MachineFrameInfo::CreateFixedObject(uint64_t, int64_t, bool, bool): Assertion `Size != 0 && "Cannot allocate zero size fixed stack objects!"' failed.
```
Stack dump:
```console
#0 0x0000ffffb141f2c4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/llvm/lib/libLLVMSupport.so.20.0git+0x18f2c4)
#1 0x0000ffffb141d0fc llvm::sys::RunSignalHandlers() (/opt/llvm/lib/libLLVMSupport.so.20.0git+0x18d0fc)
#2 0x0000ffffb141f9e4 SignalHandler(int) Signals.cpp:0:0
#3 0x0000ffffb2fbd8fc (linux-vdso.so.1+0x8fc)
#4 0x0000ffffb0e5f200 (/usr/lib/aarch64-linux-gnu/libc.so.6+0x7f200)
#5 0x0000ffffb0e1a67c gsignal (/usr/lib/aarch64-linux-gnu/libc.so.6+0x3a67c)
#6 0x0000ffffb0e07130 abort (/usr/lib/aarch64-linux-gnu/libc.so.6+0x27130)
#7 0x0000ffffb0e13fd0 (/usr/lib/aarch64-linux-gnu/libc.so.6+0x33fd0)
#8 0x0000ffffb0e14040 __assert_perror_fail (/usr/lib/aarch64-linux-gnu/libc.so.6+0x34040)
#9 0x0000ffffafcd1b38 llvm::MachineFrameInfo::CreateFixedObject(unsigned long, long, bool, bool) (/opt/llvm/lib/libLLVMCodeGen.so.20.0git+0x361b38)
#10 0x0000ffffb2a5e4d4 (anonymous namespace)::IncomingArgHandler::getStackAddress(unsigned long, long, llvm::MachinePointerInfo&, llvm::ISD::ArgFlagsTy) AArch64CallLowering.cpp:0:0
#11 0x0000ffffb0aebc70 llvm::CallLowering::handleAssignments(llvm::CallLowering::ValueHandler&, llvm::SmallVectorImpl<llvm::CallLowering::ArgInfo>&, llvm::CCState&, llvm::SmallVectorImpl<llvm::CCValAssign>&, llvm::MachineIRBuilder&, llvm::ArrayRef<llvm::Register>) const (/opt/llvm/lib/libLLVMGlobalISel.so.20.0git+0x4bc70)
#12 0x0000ffffb2a59dfc llvm::AArch64CallLowering::lowerFormalArguments(llvm::MachineIRBuilder&, llvm::Function const&, llvm::ArrayRef<llvm::ArrayRef<llvm::Register>>, llvm::FunctionLoweringInfo&) const (/opt/llvm/lib/libLLVMAArch64CodeGen.so.20.0git+0x99dfc)
#13 0x0000ffffb0b5abb0 llvm::IRTranslator::runOnMachineFunction(llvm::MachineFunction&) (/opt/llvm/lib/libLLVMGlobalISel.so.20.0git+0xbabb0)
#14 0x0000ffffafce0378 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/llvm/lib/libLLVMCodeGen.so.20.0git+0x370378)
#15 0x0000ffffae84eab0 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/llvm/lib/libLLVMCore.so.20.0git+0x24eab0)
#16 0x0000ffffae856158 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/llvm/lib/libLLVMCore.so.20.0git+0x256158)
#17 0x0000ffffae84f3b4 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/llvm/lib/libLLVMCore.so.20.0git+0x24f3b4)
#18 0x0000ffffb21fcfe0 generateMachineCodeOrAssemblyImpl(clang::DiagnosticsEngine&, llvm::TargetMachine&, Fortran::frontend::BackendActionTy, llvm::Module&, Fortran::frontend::CodeGenOptions const&, llvm::raw_pwrite_stream&) FrontendActions.cpp:0:0
#19 0x0000ffffb21fca58 Fortran::frontend::CodeGenAction::executeAction() (/opt/llvm/lib/libflangFrontend.so.20.0git+0x3ca58)
#20 0x0000ffffb21f2494 Fortran::frontend::FrontendAction::execute() (/opt/llvm/lib/libflangFrontend.so.20.0git+0x32494)
#21 0x0000ffffb21dc844 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) (/opt/llvm/lib/libflangFrontend.so.20.0git+0x1c844)
#22 0x0000ffffb27d335c Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) (/opt/llvm/lib/libflangFrontendTool.so.20.0git+0x335c)
#23 0x0000aaaad6cf46e0 fc1_main(llvm::ArrayRef<char const*>, char const*) (/opt/llvm/bin/flang+0x46e0)
#24 0x0000aaaad6cf2e98 main (/opt/llvm/bin/flang+0x2e98)
#25 0x0000ffffb0e073fc (/usr/lib/aarch64-linux-gnu/libc.so.6+0x273fc)
#26 0x0000ffffb0e074cc __libc_start_main (/usr/lib/aarch64-linux-gnu/libc.so.6+0x274cc)
#27 0x0000aaaad6cf29f0 _start (/opt/llvm/bin/flang+0x29f0)
flang-20: error: unable to execute command: Aborted (core dumped)
flang-20: error: flang frontend command failed due to signal (use -v to see invocation)
flang version 20.0.0git (https://github.com/llvm/llvm-project 7107f55d82f8d1077d5478e8f58c94851385c06f)
Target: aarch64-unknown-linux-gnu
Thread model: posix
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs