https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111906
Bug ID: 111906 Summary: ICE: segfault during GIMPLE pass: dom in gsi_prev() testsuite torture/bitint-39.c with -O1 (expensive tests) Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: rimvydas.jas at gmail dot com Target Milestone: --- Strange ICE does not happen with -O{0,2,3,s,g} or with "-O1 -save-temps", testcase does not reduce. $ GCC_TEST_RUN_EXPENSIVE=yes make -k check-gcc-c RUNTESTFLAGS="dg-torture.exp=bitint-39.c" Running /data/gcc_trunk/gcc/testsuite/gcc.dg/torture/dg-torture.exp ... FAIL: gcc.dg/torture/bitint-39.c -O1 (internal compiler error: Segmentation fault) FAIL: gcc.dg/torture/bitint-39.c -O1 (test for excess errors) === gcc Summary === # of expected passes 12 # of unexpected failures 2 # of unresolved testcases 1 /tmp/build/gcc/xgcc version 14.0.0 20231021 (experimental) [master r14-4812-g66c26e5cfdf] (GCC) $ valgrind --track-origins=yes ./gcc/cc1 /data/gcc_trunk/gcc/testsuite/gcc.dg/torture/bitint-39.c -fdiagnostics-plain-output -O1 bar t115_1add t115_2add t115_3add t115_4add t115_5add t115add t116_1add t116_2add t116_3add t116_4add t116_5add t116add t117_1add t117_2add t117_3add t117_4add t117_5add t117add t118_1add t118_2add t118_3add t118_4add t118_5add t118add t119_1add t119_2add t119_3add t119_4add t119_5add t119add t120_1add t120_2add t120_3add t120_4add t120_5add t120add t121_1add t121_2add t121_3add t121_4add t121_5add t121add t122_1add t122_2add t122_3add t122_4add t122_5add t122add t123_1add t123_2add t123_3add t123_4add t123_5add t123add t124_1add t124_2add t124_3add t124_4add t124_5add t124add t100_1add t100_2add t100_3add t100_4add t100_5add t100add t101_1add t101_2add t101_3add t101_4add t101_5add t101add t102_1sub t102_2sub t102_3sub t102_4sub t102_5sub t102sub t103_1sub t103_2sub t103_3sub t103_4sub t103_5sub t103sub t104_1mul t104_2mul t104_3mul t104_4mul t104_5mul t104mul t105_1mul t105_2mul t105_3mul t105_4mul t105_5mul t105mul t106_1mul t106_2mul t106_3mul t106_4mul t106_5mul t106mul t107_1add t107_2add t107_3add t107_4add t107_5add t107add t108_1add t108_2add t108_3add t108_4add t108_5add t108add t109_1add t109_2add t109_3add t109_4add t109_5add t109add t110_1sub t110_2sub t110_3sub t110_4sub t110_5sub t110sub t111_1add t111_2add t111_3add t111_4add t111_5add t111add t112_1add t112_2add t112_3add t112_4add t112_5add t112add t113_1add t113_2add t113_3add t113_4add t113_5add t113add t114_1add t114_2add t114_3add t114_4add t114_5add t114add main Analyzing compilation unit Performing interprocedural optimizations <*free_lang_data> {heap 0 } <visibility> {heap 0 } <build_ssa_passes> {heap 0 } <opt_local_passes> {heap 0 } <remove_symbols> {heap 0 } <targetclone> {heap 0 } <free-fnsummary> {heap 0 }Streaming LTO <whole-program> {heap 0 } <profile_estimate> {heap 0 } <fnsummary> {heap 0 } <inline> {heap 0 } <pure-const> {heap 0 } <modref> {heap 0 } <free-fnsummary> {heap 0 } <static-var> {heap 0 } <single-use> {heap 0 } <comdats> {heap 0 }Assembling functions: <simdclone> {heap 0 } bar t115_1add t115_2add t115_3add t115_4add t115_5add t115add t116_1add t116_2add t116_3add t116_4add t116_5add t116add t117_1add {GC released 1080k} {GC 5369k -> 3189k} t117_2add t117_3add t117_4add t117_5add t117add t118_1add t118_2add t118_3add t118_4add t118_5add t118add t119_1add t119_2add t119_3add t119_4add t119_5add t119add t120_1add t120_2add {GC released 1932k madv_dontneed 64k} {GC 5354k -> 3100k} t120_3add t120_4add t120_5add t120add t121_1add t121_2add t121_3add t121_4add t121_5add t121add t122_1add t122_2add t122_3add t122_4add t122_5add t122add t123_1add t123_2add {GC released 2044k} {GC 5347k -> 2993k} t123_3add t123_4add t123_5add t123add t124_1add t124_2add t124_3add t124_4add t124_5add t124add t100_1add t100_2add t100_3add t100_4add t100_5add t100add t101_1add t101_2add t101_3add t101_4add t101_5add t101add t102_1sub t102_2sub t102_3sub t102_4sub t102_5sub t102sub t103_1sub t103_2sub t103_3sub t103_4sub t103_5sub t103sub t104_1mul t104_2mul t104_3mul t104_4mul t104_5mul {GC released 1988k} {GC 5325k -> 2670k}==82656== Invalid read of size 8 ==82656== at 0x11568B4: gsi_prev (gimple-iterator.h:202) ==82656== by 0x11568B4: dom_opt_dom_walker::before_dom_children(basic_block_def*) (tree-ssa-dom.cc:1764) ==82656== by 0x1E2B86E: dom_walker::walk(basic_block_def*) (domwalk.cc:311) ==82656== by 0x1157278: (anonymous namespace)::pass_dominator::execute(function*) (tree-ssa-dom.cc:939) ==82656== by 0xEF2628: execute_one_pass(opt_pass*) (passes.cc:2641) ==82656== by 0xEF2EAF: execute_pass_list_1(opt_pass*) (passes.cc:2750) ==82656== by 0xEF2EC1: execute_pass_list_1(opt_pass*) (passes.cc:2751) ==82656== by 0xEF2EE8: execute_pass_list(function*, opt_pass*) (passes.cc:2761) ==82656== by 0xB1F345: expand (cgraphunit.cc:1841) ==82656== by 0xB1F345: cgraph_node::expand() (cgraphunit.cc:1794) ==82656== by 0xB2111A: expand_all_functions (cgraphunit.cc:2024) ==82656== by 0xB2111A: symbol_table::compile() [clone .part.0] (cgraphunit.cc:2398) ==82656== by 0xB23797: compile (cgraphunit.cc:2311) ==82656== by 0xB23797: symbol_table::finalize_compilation_unit() (cgraphunit.cc:2583) ==82656== by 0x101A941: compile_file() (toplev.cc:471) ==82656== by 0x93F0E9: do_compile (toplev.cc:2126) ==82656== by 0x93F0E9: toplev::main(int, char**) (toplev.cc:2282) ==82656== Address 0x78a6d38 is in a rw- anonymous segment ==82656== ==82656== Invalid read of size 1 ==82656== at 0x1156850: dom_opt_dom_walker::before_dom_children(basic_block_def*) (tree-ssa-dom.cc:1766) ==82656== by 0x1E2B86E: dom_walker::walk(basic_block_def*) (domwalk.cc:311) ==82656== by 0x1157278: (anonymous namespace)::pass_dominator::execute(function*) (tree-ssa-dom.cc:939) ==82656== Address 0x78a6d21 is in a rw- anonymous segment ==82656== ==82656== Invalid read of size 8 ==82656== at 0x11568B0: gsi_prev (gimple-iterator.h:201) ==82656== by 0x11568B0: dom_opt_dom_walker::before_dom_children(basic_block_def*) (tree-ssa-dom.cc:1764) ==82656== by 0x1E2B86E: dom_walker::walk(basic_block_def*) (domwalk.cc:311) ==82656== by 0x1157278: (anonymous namespace)::pass_dominator::execute(function*) (tree-ssa-dom.cc:939) ==82656== Address 0x78a6d40 is in a rw- anonymous segment ==82656== during GIMPLE pass: dom In file included from /data/gcc_trunk/gcc/testsuite/gcc.dg/torture/bitint-39.c:9: /data/gcc_trunk/gcc/testsuite/gcc.dg/torture/bitint-39.c: In function 't104_5mul': /data/gcc_trunk/gcc/testsuite/gcc.dg/torture/../../c-c++-common/torture/builtin-arith-overflow.h:126:1: internal compiler error: Segmentation fault /data/gcc_trunk/gcc/testsuite/gcc.dg/torture/../../c-c++-common/torture/builtin-arith-overflow.h:156:1: note: in expansion of macro 'TP' /data/gcc_trunk/gcc/testsuite/gcc.dg/torture/bitint-39.c:22:1: note: in expansion of macro 'T' /data/gcc_trunk/gcc/testsuite/gcc.dg/torture/bitint-39.c:44:1: note: in expansion of macro 'TESTS' ==82656== Warning: set address range perms: large range [0x804e000, 0x1c420000) (defined) 0x101a47f crash_signal /data/gcc_trunk/gcc/toplev.cc:314 0x497049f ??? /tmp/glibc-2.34/signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 0x11568b4 gsi_prev(gimple_stmt_iterator*) /data/gcc_trunk/gcc/gimple-iterator.h:202 0x11568b4 dom_opt_dom_walker::before_dom_children(basic_block_def*) /data/gcc_trunk/gcc/tree-ssa-dom.cc:1764 0x1e2b86e dom_walker::walk(basic_block_def*) /data/gcc_trunk/gcc/domwalk.cc:311 0x1157278 execute /data/gcc_trunk/gcc/tree-ssa-dom.cc:939 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. 202 if (prev->next) (gdb) p *prev Cannot access memory at address 0xa5a5a5a5a5a5a5a5 (gdb) p *i->ptr $1 = {code = GIMPLE_ASSIGN, no_warning = 0, visited = 1, nontemporal_move = 0, plf = 1, modified = 0, has_volatile_ops = 1, pad = 0, subcode = 57, uid = 0, location = 0, num_ops = 2, bb = 0x2aaaab0e5000, next = 0x2aaaab0e3230, prev = 0x2aaaab35bd20} (gdb) p *i->ptr->prev $2 = {code = 165, no_warning = 1, visited = 0, nontemporal_move = 1, plf = 0, modified = 1, has_volatile_ops = 0, pad = 1, subcode = 42405, uid = 2779096485, location = 2779096485, num_ops = 2779096485, bb = 0xa5a5a5a5a5a5a5a5, next = 0xa5a5a5a5a5a5a5a5, prev = 0xa5a5a5a5a5a5a5a5}