https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106878
Bug ID: 106878 Summary: ICE: verify_gimple failed at -O2 on arm-none-eabi Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: acoplan at gcc dot gnu.org Target Milestone: --- The following fails for GCC 11 and above (indeed still on the trunk): $ gcc/xgcc -B gcc -v Reading specs from gcc/specs COLLECT_GCC=gcc/xgcc COLLECT_LTO_WRAPPER=gcc/lto-wrapper Target: arm-none-eabi Configured with: /home/alecop01/toolchain/src/gcc/configure --prefix=/data_sdb/toolchain/cc1s/dbg-arm --enable-languages=c,c++ --disable-bootstrap --target=arm-none-eabi Thread model: single Supported LTO compression algorithms: zlib gcc version 13.0.0 20220907 (experimental) (GCC) $ cat t.c int a; void b(const int *c) { unsigned d = ((long)c | (long)&a) & 65535 << 16; long e = (long)c; if (d != (e & 65535 << 16)) return; } $ gcc/xgcc -B gcc -c t.c -O2 -S -o /dev/null t.c: In function ‘b’: t.c:7:1: error: invalid types for ‘bit_not_expr’ 7 | } | ^ const int * const int * _12 = ~c_7(D); during GIMPLE pass: forwprop t.c:7:1: internal compiler error: verify_gimple failed 0xe0c855 verify_gimple_in_cfg(function*, bool) /home/alecop01/toolchain/src/gcc/gcc/tree-cfg.cc:5568 0xca78be execute_function_todo /home/alecop01/toolchain/src/gcc/gcc/passes.cc:2091 0xca8342 execute_todo /home/alecop01/toolchain/src/gcc/gcc/passes.cc:2145 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. $ gcc/xgcc -B gcc -c t.c -O2 -S -o /dev/null -fno-checking during GIMPLE pass: evrp t.c: In function ‘b’: t.c:7:1: internal compiler error: Segmentation fault 7 | } | ^ 0xdb06ef crash_signal /home/alecop01/toolchain/src/gcc/gcc/toplev.cc:314 0x1a70ca1 range_op_handler::fold_range(vrange&, tree_node*, vrange const&, vrange const&, relation_kind_t) const /home/alecop01/toolchain/src/gcc/gcc/range-op.cc:4217 0x1a755cb operator_bitwise_not::fold_range(irange&, tree_node*, irange const&, irange const&, relation_kind_t) const /home/alecop01/toolchain/src/gcc/gcc/range-op.cc:3507 0x1948cd7 fold_using_range::range_of_range_op(vrange&, gimple*, fur_source&) /home/alecop01/toolchain/src/gcc/gcc/gimple-range-fold.cc:611 0x194ae68 fold_using_range::fold_stmt(vrange&, gimple*, fur_source&, tree_node*) /home/alecop01/toolchain/src/gcc/gcc/gimple-range-fold.cc:555 0x19358ec gimple_ranger::fold_range_internal(vrange&, gimple*, tree_node*) /home/alecop01/toolchain/src/gcc/gcc/gimple-range.cc:258 0x19371f0 gimple_ranger::range_of_stmt(vrange&, gimple*, tree_node*) /home/alecop01/toolchain/src/gcc/gcc/gimple-range.cc:319 0x113ec83 range_query::value_of_stmt(gimple*, tree_node*) /home/alecop01/toolchain/src/gcc/gcc/value-query.cc:135 0xfcda70 substitute_and_fold_dom_walker::before_dom_children(basic_block_def*) /home/alecop01/toolchain/src/gcc/gcc/tree-ssa-propagate.cc:816 0x18f9e47 dom_walker::walk(basic_block_def*) /home/alecop01/toolchain/src/gcc/gcc/domwalk.cc:311 0xfcc8b5 substitute_and_fold_engine::substitute_and_fold(basic_block_def*) /home/alecop01/toolchain/src/gcc/gcc/tree-ssa-propagate.cc:987 0x10f3430 execute_ranger_vrp(function*, bool) /home/alecop01/toolchain/src/gcc/gcc/tree-vrp.cc:4349 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.