[llvm] [ConstantInt] Disable implicit truncation in ConstantInt::get() (PR #171456)

Mikael Holmen via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 7 04:43:12 PST 2026


mikaelholmen wrote:

Hi @nikic 

llvm-stress crashes after a83c89495b.
E.g.
```llvm-stress -size 300 -seed 17745```
hits
```
llvm-stress: ../include/llvm/ADT/APInt.h:128: llvm::APInt::APInt(unsigned int, uint64_t, bool, bool): Assertion `llvm::isUIntN(BitWidth, val) && "Value is not an N-bit unsigned value"' 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: build-all/bin/llvm-stress -size 300 -seed 17745
 #0 0x0000561f30c69f66 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build-all/bin/llvm-stress+0x307f66)
 #1 0x0000561f30c67845 llvm::sys::RunSignalHandlers() (build-all/bin/llvm-stress+0x305845)
 #2 0x0000561f30c6ad69 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007fefecf2c990 __restore_rt (/lib64/libpthread.so.0+0x12990)
 #4 0x00007fefea8cb52f raise (/lib64/libc.so.6+0x4e52f)
 #5 0x00007fefea89ee65 abort (/lib64/libc.so.6+0x21e65)
 #6 0x00007fefea89ed39 _nl_load_domain.cold.0 (/lib64/libc.so.6+0x21d39)
 #7 0x00007fefea8c3e86 (/lib64/libc.so.6+0x46e86)
 #8 0x0000561f30b2cf55 llvm::APInt::APInt(unsigned int, unsigned long, bool, bool) ConstantRange.cpp:0:0
 #9 0x0000561f30b2f8b6 llvm::ConstantInt::get(llvm::Type*, unsigned long, bool, bool) (build-all/bin/llvm-stress+0x1cd8b6)
#10 0x0000561f30af40a2 llvm::(anonymous namespace)::ConstModifier::Act() llvm-stress.cpp:0:0
#11 0x0000561f30aefd17 main (build-all/bin/llvm-stress+0x18dd17)
#12 0x00007fefea8b77e5 __libc_start_main (/lib64/libc.so.6+0x3a7e5)
#13 0x0000561f30aef08e _start (build-all/bin/llvm-stress+0x18d08e)
Abort (core dumped)
```

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


More information about the llvm-commits mailing list