Issue 61674
Summary opt: ../include/llvm/Support/Casting.h:708: auto llvm::cast_if_present(Y *) [X = llvm::Constant, Y = llvm::Value]: Assertion `isa<X>(Val) && "cast_if_present<Ty>() argument of incompatible type!"' failed. with opt -passes=globalopt
Labels new issue
Assignees
Reporter mikaelholmen
    llvm commit: cf60d3f1a6886
Reproduce with: ```opt -passes="globalopt" bbi-80589.ll -o /dev/null```
Result:
```
opt: ../include/llvm/Support/Casting.h:708: auto llvm::cast_if_present(Y *) [X = llvm::Constant, Y = llvm::Value]: Assertion `isa<X>(Val) && "cast_if_present<Ty>() argument of incompatible type!"' 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 -passes=globalopt bbi-80589.ll -o /dev/null
 #0 0x0000000002e65d68 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build-all/bin/opt+0x2e65d68)
 #1 0x0000000002e638fe llvm::sys::RunSignalHandlers() (build-all/bin/opt+0x2e638fe)
 #2 0x0000000002e663e6 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007fba1b02c630 __restore_rt sigaction.c:0:0
 #4 0x00007fba18773387 raise (/lib64/libc.so.6+0x36387)
 #5 0x00007fba18774a78 abort (/lib64/libc.so.6+0x37a78)
 #6 0x00007fba1876c1a6 __assert_fail_base (/lib64/libc.so.6+0x2f1a6)
 #7 0x00007fba1876c252 (/lib64/libc.so.6+0x2f252)
 #8 0x00000000026ac7d5 llvm::ConstantExprKeyType::ConstantExprKeyType(llvm::ConstantExpr const*, llvm::SmallVectorImpl<llvm::Constant*>&) crtstuff.c:0:0
 #9 0x00000000026ac4de llvm::ConstantUniqueMap<llvm::ConstantExpr>::MapInfo::getHashValue(llvm::ConstantExpr const*) crtstuff.c:0:0
#10 0x00000000026a0285 llvm::ConstantUniqueMap<llvm::ConstantExpr>::remove(llvm::ConstantExpr*) crtstuff.c:0:0
#11 0x0000000002691f10 llvm::Constant::destroyConstant() (build-all/bin/opt+0x2691f10)
#12 0x0000000003172eb9 CleanupPointerRootUsers(llvm::GlobalVariable*, llvm::function_ref<llvm::TargetLibraryInfo& (llvm::Function&)>) GlobalOpt.cpp:0:0
#13 0x000000000316d38a processInternalGlobal(llvm::GlobalVariable*, llvm::GlobalStatus const&, llvm::function_ref<llvm::TargetTransformInfo& (llvm::Function&)>, llvm::function_ref<llvm::TargetLibraryInfo& (llvm::Function&)>, llvm::function_ref<llvm::DominatorTree& (llvm::Function&)>) GlobalOpt.cpp:0:0
#14 0x000000000316ccdd processGlobal(llvm::GlobalValue&, llvm::function_ref<llvm::TargetTransformInfo& (llvm::Function&)>, llvm::function_ref<llvm::TargetLibraryInfo& (llvm::Function&)>, llvm::function_ref<llvm::DominatorTree& (llvm::Function&)>) GlobalOpt.cpp:0:0
#15 0x000000000316ad2a optimizeGlobalsInModule(llvm::Module&, llvm::DataLayout const&, llvm::function_ref<llvm::TargetLibraryInfo& (llvm::Function&)>, llvm::function_ref<llvm::TargetTransformInfo& (llvm::Function&)>, llvm::function_ref<llvm::BlockFrequencyInfo& (llvm::Function&)>, llvm::function_ref<llvm::DominatorTree& (llvm::Function&)>, llvm::function_ref<void (llvm::Function&)>, llvm::function_ref<void (llvm::Function&)>) GlobalOpt.cpp:0:0
#16 0x0000000003168ee2 llvm::GlobalOptPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build-all/bin/opt+0x3168ee2)
#17 0x000000000308441d llvm::detail::PassModel<llvm::Module, llvm::GlobalOptPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) crtstuff.c:0:0
#18 0x00000000027d91ab llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (build-all/bin/opt+0x27d91ab)
#19 0x000000000073cbf3 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool) (build-all/bin/opt+0x73cbf3)
#20 0x000000000074b1f2 main (build-all/bin/opt+0x74b1f2)
#21 0x00007fba1875f555 __libc_start_main (/lib64/libc.so.6+0x22555)
#22 0x0000000000735e50 _start (build-all/bin/opt+0x735e50)
Abort (core dumped)
```
[bbi-80589.ll.gz](https://github.com/llvm/llvm-project/files/11060204/bbi-80589.ll.gz)

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to