Created attachment 42382 [details] Reproducer gcc trunk, rev253744, x86_64. Trying compile attached test case with UBSAN I get segfault: during RTL pass: cprop f.cpp: In function ‘void tf_1_foo()’: f.cpp:335:3: internal compiler error: Segmentation fault } ^ 0xf4b65f crash_signal ../../gcc/gcc/toplev.c:326 0x1684418 sbitmap_vector_alloc(unsigned int, unsigned int) ../../gcc/gcc/sbitmap.c:171 0x1562dc3 alloc_cprop_mem ../../gcc/gcc/cprop.c:558 0x1562dc3 one_cprop_pass ../../gcc/gcc/cprop.c:1818 0x1562dc3 execute_rtl_cprop ../../gcc/gcc/cprop.c:1932 0x1562dc3 execute ../../gcc/gcc/cprop.c:1970 This is due to sbitmap_vector_alloc() implementation using "unsigned int", instead of size_t. Fixing this make test case compile (even though consuming a lot of memory, about 80Gb). >g++ -std=c++11 -fsanitize=undefined -fno-sanitize-recover=undefined -w -Werror=uninitialized -O2 -c f.cpp
Confirmed, note that also bitmap.h contains API where we have 'unsigned int'. I can work on that, do we want to change API of both?
No, I think the public API shouldn't change (we don't want to grow simple_bitmap_def unnecessarily). Such big sbitmaps do not make sense.
Still occurs in gcc 10.x
duplicate *** This bug has been marked as a duplicate of bug 97554 ***