Issue 240085
Summary [Attributor] Assertion `getSignificantBits() <= 64 && "Too many bits for int64_t"' failed.
Labels crash, llvm::Attributor
Assignees
Reporter k-arrows
    Reproducer:
https://godbolt.org/z/8WMcc7q8r
```llvm
target datalayout = "p:128:128-i128:128"

define ptr @index() {
  %r = getelementptr i8, ptr null, i128 18446744073709551621
  ret ptr %r
}
```

Backtrace:
```console
opt: /root/llvm-project/llvm/include/llvm/ADT/APInt.h:1585: int64_t llvm::APInt::getSExtValue() const: Assertion `getSignificantBits() <= 64 && "Too many bits for int64_t"' 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 0x00007fcb88845330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #4 0x00007fcb8889ec0c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9ec0c)
 #5 0x00007fcb8884527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
 #6 0x00007fcb888288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
 #7 0x00007fcb8882881b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
 #8 0x00007fcb8883b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
 #9 0x0000000003470e01 (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3470e01)
#10 0x00000000033d3f36 llvm::AbstractAttribute::update(llvm::Attributor&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x33d3f36)
#11 0x00000000033e5aeb llvm::Attributor::updateAA(llvm::AbstractAttribute&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x33e5aeb)
#12 0x00000000033f97fb llvm::AADereferenceable const* llvm::Attributor::getOrCreateAAFor<llvm::AADereferenceable>(llvm::IRPosition, llvm::AbstractAttribute const*, llvm::DepClassTy, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x33f97fb)
#13 0x000000000347164b bool llvm::function_ref<bool (llvm::Value&)>::callback_fn<void clampReturnedValueStates<llvm::AADereferenceable, llvm::DerefState, (llvm::Attribute::AttrKind)100, true>(llvm::Attributor&, llvm::AADereferenceable const&, llvm::DerefState&, llvm::CallBase const*)::'lambda'(llvm::Value&)>(long, llvm::Value&) AttributorAttributes.cpp:0:0
#14 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)
#15 0x0000000003437c77 (anonymous namespace)::AAReturnedFromReturnedValues<llvm::AADereferenceable, (anonymous namespace)::AADereferenceableImpl, llvm::DerefState, false, (llvm::Attribute::AttrKind)100, true>::updateImpl(llvm::Attributor&) AttributorAttributes.cpp:0:0
#16 0x00000000033d3f36 llvm::AbstractAttribute::update(llvm::Attributor&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x33d3f36)
#17 0x00000000033e5aeb llvm::Attributor::updateAA(llvm::AbstractAttribute&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x33e5aeb)
#18 0x00000000033f97fb llvm::AADereferenceable const* llvm::Attributor::getOrCreateAAFor<llvm::AADereferenceable>(llvm::IRPosition, llvm::AbstractAttribute const*, llvm::DepClassTy, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x33f97fb)
#19 0x00000000033fbd80 llvm::Attributor::identifyDefaultAbstractAttributes(llvm::Function&) (.part.0) Attributor.cpp:0:0
#20 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
#21 0x0000000003409489 llvm::AttributorPass::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x3409489)
#22 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)
#23 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)
#24 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)
#25 0x0000000000990571 optMain (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x990571)
#26 0x000000000083e9a0 main (/opt/compiler-explorer/clang-assertions-trunk/bin/opt+0x83e9a0)
#27 0x00007fcb8882a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#28 0x00007fcb8882a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#29 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

Reply via email to