https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97238
Bug ID: 97238 Summary: [11 Regression] ICE: SIGSEGV in gimple_assign_rhs_code (gimple.h:2797) with -O Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Host: x86_64-pc-linux-gnu Created attachment 49284 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49284&action=edit reduced testcase Compiler output: $ x86_64-pc-linux-gnu-gcc -O testcase.c -wrapper valgrind,-q ==31466== Invalid read of size 2 ==31466== at 0x750E2C: gimple_assign_rhs_code (gimple.h:2797) ==31466== by 0x750E2C: ovce_extract_ops(tree_node*, gassign**, bool*, tree_node**, tree_node**, tree_node**, gassign**) [clone .part.0] [clone .isra.0] [clone .cold] (tree-ssa-reassoc.c:3914) ==31466== by 0x119A493: ovce_extract_ops (tree-ssa-reassoc.c:3893) ==31466== by 0x119A493: optimize_vec_cond_expr (tree-ssa-reassoc.c:3970) ==31466== by 0x119A493: reassociate_bb(basic_block_def*) (tree-ssa-reassoc.c:6465) ==31466== by 0x1199DE8: reassociate_bb(basic_block_def*) (tree-ssa-reassoc.c:6606) ==31466== by 0x119C25E: do_reassoc (tree-ssa-reassoc.c:6718) ==31466== by 0x119C25E: execute_reassoc (tree-ssa-reassoc.c:6805) ==31466== by 0x119C25E: (anonymous namespace)::pass_reassoc::execute(function*) (tree-ssa-reassoc.c:6844) ==31466== by 0xEFBDF7: execute_one_pass(opt_pass*) (passes.c:2509) ==31466== by 0xEFC76F: execute_pass_list_1(opt_pass*) (passes.c:2597) ==31466== by 0xEFC781: execute_pass_list_1(opt_pass*) (passes.c:2598) ==31466== by 0xEFC7A8: execute_pass_list(function*, opt_pass*) (passes.c:2608) ==31466== by 0xB88B8B: cgraph_node::expand() (cgraphunit.c:2309) ==31466== by 0xB8A0EF: expand_all_functions (cgraphunit.c:2480) ==31466== by 0xB8A0EF: symbol_table::compile() [clone .part.0] (cgraphunit.c:2843) ==31466== by 0xB8C522: compile (cgraphunit.c:2756) ==31466== by 0xB8C522: symbol_table::finalize_compilation_unit() (cgraphunit.c:3021) ==31466== by 0xFF2AC9: compile_file() (toplev.c:484) ==31466== Address 0x2 is not stack'd, malloc'd or (recently) free'd ==31466== during GIMPLE pass: reassoc testcase.c: In function 'foo': testcase.c:6:1: internal compiler error: Segmentation fault 6 | foo (void) | ^~~ 0x4fd9cfa __libc_start_main ???:0 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-r11-3519-20200929092607-ge46858e4eee-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.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 --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-r11-3519-20200929092607-ge46858e4eee-checking-yes-rtl-df-extra-amd64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.0.0 20200929 (experimental) (GCC)