https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103404

            Bug ID: 103404
           Summary: ICE: SIGSEGV in insert_with_costs (cse.c:1569) with
                    custom flags
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu

Created attachment 51865
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51865&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Og -fcse-follow-jumps -fno-dce -fno-early-inlining
-fgcse -fharden-conditional-branches -frerun-cse-after-loop -fno-tree-ccp
-mavx5124fmaps testcase.c -wrapper valgrind,-q
==24674== Invalid read of size 4
==24674==    at 0x2242C56: insert_with_costs(rtx_def*, table_elt*, unsigned
int, machine_mode, int, int) (cse.c:1569)
==24674==    by 0x2244F70: insert (cse.c:1695)
==24674==    by 0x2244F70: merge_equiv_classes(table_elt*, table_elt*) [clone
.isra.0] (cse.c:1756)
==24674==    by 0x224F7F9: record_jump_equiv (cse.c:3891)
==24674==    by 0x224F7F9: cse_extended_basic_block (cse.c:6614)
==24674==    by 0x224F7F9: cse_main(rtx_insn*, int) [clone .constprop.0]
(cse.c:6706)
==24674==    by 0x224FE40: rest_of_handle_cse2 (cse.c:7592)
==24674==    by 0x224FE40: (anonymous namespace)::pass_cse2::execute(function*)
(cse.c:7645)
==24674==    by 0x126020C: execute_one_pass(opt_pass*) (passes.c:2567)
==24674==    by 0x1260A7F: execute_pass_list_1(opt_pass*) (passes.c:2656)
==24674==    by 0x1260A91: execute_pass_list_1(opt_pass*) (passes.c:2657)
==24674==    by 0x1260AB8: execute_pass_list(function*, opt_pass*)
(passes.c:2667)
==24674==    by 0xE947D5: expand (cgraphunit.c:1834)
==24674==    by 0xE947D5: cgraph_node::expand() (cgraphunit.c:1787)
==24674==    by 0xE95D1F: expand_all_functions (cgraphunit.c:1998)
==24674==    by 0xE95D1F: symbol_table::compile() [clone .part.0]
(cgraphunit.c:2362)
==24674==    by 0xE98957: compile (cgraphunit.c:2275)
==24674==    by 0xE98957: symbol_table::finalize_compilation_unit()
(cgraphunit.c:2543)
==24674==    by 0x1369EFF: compile_file() (toplev.c:479)
==24674==  Address 0x40 is not stack'd, malloc'd or (recently) free'd
==24674== 
during RTL pass: cse2
testcase.c: In function 'foo':
testcase.c:28:1: internal compiler error: Segmentation fault
   28 | }
      | ^
0x1369c3f crash_signal
        /repo/gcc-trunk/gcc/toplev.c:322
0x2242c56 insert_with_costs
        /repo/gcc-trunk/gcc/cse.c:1569
0x2244f70 insert
        /repo/gcc-trunk/gcc/cse.c:1695
0x2244f70 merge_equiv_classes
        /repo/gcc-trunk/gcc/cse.c:1756
0x224f7f9 record_jump_equiv
        /repo/gcc-trunk/gcc/cse.c:3891
0x224f7f9 cse_extended_basic_block
        /repo/gcc-trunk/gcc/cse.c:6614
0x224f7f9 cse_main
        /repo/gcc-trunk/gcc/cse.c:6706
0x224fe40 rest_of_handle_cse2
        /repo/gcc-trunk/gcc/cse.c:7592
0x224fe40 execute
        /repo/gcc-trunk/gcc/cse.c:7645
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-5492-20211124095444-g04eccbbe3d9-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-5492-20211124095444-g04eccbbe3d9-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20211124 (experimental) (GCC)

Reply via email to