[llvm] [RemoveDIs] Add flag to preserve the debug info format of input IR (PR #87379)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 8 03:50:11 PDT 2024


mikaelholmen wrote:

Hello @SLTozer 
With this patch, the following starts crashing:
```
clang -cc1 -emit-llvm-bc -debug-info-kind=constructor -o bbi-94196.bc bbi-94196.c
opt bbi-94196.bc -o bbi-94196.opt.bc
```
It results in
```
opt: ../lib/IR/BasicBlock.cpp:85: void llvm::BasicBlock::convertToNewDbgValues(): Assertion `!I.DebugMarker && "DebugMarker already set on old-format instrs?"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: build-all/bin/opt bbi-94196.bc -o bbi-94196.opt.bc
 #0 0x0000558b7a61d537 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build-all/bin/opt+0x3e1e537)
 #1 0x0000558b7a61b00e llvm::sys::RunSignalHandlers() (build-all/bin/opt+0x3e1c00e)
 #2 0x0000558b7a61deff SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f7429cfb630 __restore_rt sigaction.c:0:0
 #4 0x00007f7427442387 raise (/lib64/libc.so.6+0x36387)
 #5 0x00007f7427443a78 abort (/lib64/libc.so.6+0x37a78)
 #6 0x00007f742743b1a6 __assert_fail_base (/lib64/libc.so.6+0x2f1a6)
 #7 0x00007f742743b252 (/lib64/libc.so.6+0x2f252)
 #8 0x0000558b7a75f32a llvm::BasicBlock::convertToNewDbgValues() (build-all/bin/opt+0x3f6032a)
 #9 0x0000558b7a74df5e llvm::Function::convertToNewDbgValues() (build-all/bin/opt+0x3f4ef5e)
#10 0x0000558b7a69309e llvm::Module::setIsNewDbgInfoFormat(bool) IRPrintingPasses.cpp:0:0
#11 0x0000558b7a7ff61d llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build-all/bin/opt+0x400061d)
#12 0x0000558b7b8ce33b llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool) (build-all/bin/opt+0x50cf33b)
#13 0x0000558b7a5e5aad optMain (build-all/bin/opt+0x3de6aad)
#14 0x00007f742742e555 __libc_start_main (/lib64/libc.so.6+0x22555)
#15 0x0000558b7a5df629 _start (build-all/bin/opt+0x3de0629)
Abort (core dumped)
```
[bbi-94196.c.gz](https://github.com/llvm/llvm-project/files/14904496/bbi-94196.c.gz)


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


More information about the llvm-commits mailing list