| Issue |
240083
|
| Summary |
[Attributor] Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
|
| Labels |
crash,
llvm::Attributor
|
| Assignees |
|
| Reporter |
k-arrows
|
Reproducer:
https://godbolt.org/z/EPx44hs3r
```llvm
define i32 @main2() {
ret i32 0
}
define ptr @ctime2(ptr %p) {
ret ptr %p
}
define ptr @ctime(ptr) {
entry:
%i0 = call ptr @main2( )
ret ptr %i0
}
```
Backtrace:
```console
opt: /root/llvm-project/llvm/include/llvm/Support/Casting.h:572: decltype(auto) llvm::cast(From*) [with To = llvm::PointerType; From = llvm::Type]: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/opt -o /app/output.s -S -passes=attributor <source>
1. Running pass "attributor" on module "<source>"
#0 0x00000000008ccfb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x8ccfb8)
#1 0x00000000008c9da4 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x8c9da4)
#2 0x00000000008c9f1e SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x000074e5b2e45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#4 0x000074e5b2e9ec0c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9ec0c)
#5 0x000074e5b2e4527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
#6 0x000074e5b2e288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
#7 0x000074e5b2e2881b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
#8 0x000074e5b2e3b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#9 0x0000000000d39077 llvm::Type::getPointerAddressSpace() const (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0xd39077)
#10 0x0000000003434f0a llvm::AANonNull::isImpliedByIR(llvm::Attributor&, llvm::IRPosition const&, llvm::Attribute::AttrKind, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3434f0a)
#11 0x0000000003491f69 bool llvm::function_ref<bool (llvm::Value&)>::callback_fn<void clampReturnedValueStates<llvm::AANonNull, llvm::BooleanState, (llvm::Attribute::AttrKind)49, false>(llvm::Attributor&, llvm::AANonNull const&, llvm::BooleanState&, llvm::CallBase const*)::'lambda'(llvm::Value&)>(long, llvm::Value&) AttributorAttributes.cpp:0:0
#12 0x00000000033ed9be llvm::Attributor::checkForAllReturnedValues(llvm::function_ref<bool (llvm::Value&)>, llvm::AbstractAttribute const&, llvm::AA::ValueScope, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x33ed9be)
#13 0x000000000342f123 (anonymous namespace)::AAReturnedFromReturnedValues<llvm::AANonNull, llvm::AANonNull, llvm::BooleanState, false, (llvm::Attribute::AttrKind)49, false>::updateImpl(llvm::Attributor&) AttributorAttributes.cpp:0:0
#14 0x00000000033d3f36 llvm::AbstractAttribute::update(llvm::Attributor&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x33d3f36)
#15 0x00000000033e5aeb llvm::Attributor::updateAA(llvm::AbstractAttribute&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x33e5aeb)
#16 0x00000000033f8a4b void llvm::Attributor::checkAndQueryIRAttr<(llvm::Attribute::AttrKind)49, llvm::AANonNull>(llvm::IRPosition const&, llvm::AttributeSet, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x33f8a4b)
#17 0x00000000033fbcc9 llvm::Attributor::identifyDefaultAbstractAttributes(llvm::Function&) (.part.0) Attributor.cpp:0:0
#18 0x000000000340878b runAttributorOnFunctions(llvm::InformationCache&, llvm::SetVector<llvm::Function*, llvm::SmallVector<llvm::Function*, 0u>, llvm::DenseSet<llvm::Function*, llvm::DenseMapInfo<llvm::Function*, void>>, 0u>&, llvm::CallGraphUpdater&, llvm::AnalysisManager<llvm::Function>&, bool, bool) (.part.0) Attributor.cpp:0:0
#19 0x0000000003409489 llvm::AttributorPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3409489)
#20 0x000000000327d79e llvm::detail::PassModel<llvm::Module, llvm::AttributorPass, llvm::AnalysisManager<llvm::Module>>::runImpl(llvm::detail::PassConcept<llvm::Module, llvm::AnalysisManager<llvm::Module>>&, llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x327d79e)
#21 0x0000000005bc1c0e llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x5bc1c0e)
#22 0x000000000099b13a llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPluginLibraryInfo>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x99b13a)
#23 0x0000000000990571 optMain (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x990571)
#24 0x000000000083e9a0 main (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x83e9a0)
#25 0x000074e5b2e2a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#26 0x000074e5b2e2a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#27 0x00000000008abcd5 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x8abcd5)
Program terminated with signal SIGABRT (6)
Compiler returned: 134
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs