[llvm] [RemoveDIs] Load into new debug info format by default in LLVM (PR #89799)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 11 02:41:39 PDT 2024


jeanPerier wrote:

I think this patch is causing a buildbot failure with a flang test in the llvm-test-suite using -g and -flto.: https://lab.llvm.org/buildbot/#/builders/198/builds/10772

An assert is hit in llvm::Module::removeDebugIntrinsicDeclarations.

Reproducer:

file.f90:
```
subroutine sub()
 real :: x
end subroutine
```

`flang-new -c -g -flto file.f90`

```
flang-new: llvm/lib/IR/Module.cpp:94: void llvm::Module::removeDebugIntrinsicDeclarations(): Assertion `(!isMaterialized() || DeclareIntrinsicFn->hasZeroLiveUses()) && "Debug declare intrinsic should have had uses removed."' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: bin/flang-new -fc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -fcolor-diagnostics -flto=full -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu x86-64 -debug-info-kind=standalone -resource-dir bin/.. -mframe-pointer=all -o - -x f95-cpp-input rep_crash.f90
 #0 0x00005635907c86c8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (bin/flang-new+0x2ea86c8)
 #1 0x00005635907c636e llvm::sys::RunSignalHandlers() (bin/flang-new+0x2ea636e)
 #2 0x00005635907c9038 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007fcbada42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007fcbada969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007fcbada969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x00007fcbada969fc pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x00007fcbada42476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007fcbada287f3 abort ./stdlib/abort.c:81:7
 #9 0x00007fcbada2871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x00007fcbada39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#11 0x0000563594ec414a llvm::Module::removeDebugIntrinsicDeclarations() (bin/flang-new+0x75a414a)
#12 0x0000563593e6ae9b llvm::BitcodeWriterPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (bin/flang-new+0x654ae9b)
#13 0x00005635908f523d llvm::detail::PassModel<llvm::Module, llvm::BitcodeWriterPass, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) FrontendActions.cpp:0:0
#14 0x0000563594ed6356 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (bin/flang-new+0x75b6356)
#15 0x000056359081048d Fortran::frontend::CodeGenAction::runOptimizationPipeline(llvm::raw_pwrite_stream&) (bin/flang-new+0x2ef048d)
#16 0x0000563590812a32 Fortran::frontend::CodeGenAction::executeAction() (bin/flang-new+0x2ef2a32)
#17 0x000056359080349c Fortran::frontend::FrontendAction::execute() (bin/flang-new+0x2ee349c)
#18 0x00005635907df712 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) (bin/flang-new+0x2ebf712)
#19 0x00005635908077ef Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) (bin/flang-new+0x2ee77ef)
#20 0x00005635903837d6 fc1_main(llvm::ArrayRef<char const*>, char const*) (bin/flang-new+0x2a637d6)
#21 0x0000563590381e4b main (bin/flang-new+0x2a61e4b)
#22 0x00007fcbada29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#23 0x00007fcbada29e40 call_init ./csu/../csu/libc-start.c:128:20
#24 0x00007fcbada29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#25 0x0000563590381865 _start (bin/flang-new+0x2a61865)
```

I was unable to reproduce when dumping llvm IR and starting back from that, but one can see the llvm-ir with debug info generated for that Fortran program with `flang-new -fc1 -emit-llvm -debug-info-kind=standalone`.

FYI @abidh.


https://github.com/llvm/llvm-project/pull/89799


More information about the llvm-commits mailing list