https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93333
Bug ID: 93333 Summary: ICE: RTL check: expected code 'const_int', have 'and' in riscv_rtx_costs, at config/riscv/riscv.c:1645 Product: gcc Version: 10.0 Status: UNCONFIRMED Keywords: ice-checking, ice-on-valid-code Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Host: x86_64-pc-linux-gnu Target: riscv64-unknown-linux-gnu Created attachment 47684 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47684&action=edit reduced testcase RTL checking might be needed to reproduce this. Compiler output: $ riscv64-unknown-linux-gnu-gcc -O2 testcase.c during RTL pass: combine testcase.c: In function 'foo': testcase.c:8:1: internal compiler error: RTL check: expected code 'const_int', have 'and' in riscv_rtx_costs, at config/riscv/riscv.c:1645 8 | } | ^ 0x6ce0f9 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int, char const*) /repo/gcc-trunk/gcc/rtl.c:879 0x7979c1 riscv_rtx_costs /repo/gcc-trunk/gcc/config/riscv/riscv.c:1645 0xe3d427 rtx_cost(rtx_def*, machine_mode, rtx_code, int, bool) /repo/gcc-trunk/gcc/rtlanal.c:4279 0x14b56bc set_src_cost /repo/gcc-trunk/gcc/rtl.h:2932 0x14b56bc make_extraction /repo/gcc-trunk/gcc/combine.c:7980 0x14b9438 make_compound_operation_int /repo/gcc-trunk/gcc/combine.c:8194 0x14b9438 make_compound_operation(rtx_def*, rtx_code) /repo/gcc-trunk/gcc/combine.c:8510 0x14be356 simplify_set /repo/gcc-trunk/gcc/combine.c:7031 0x14be356 combine_simplify_rtx /repo/gcc-trunk/gcc/combine.c:6441 0x14c278f subst /repo/gcc-trunk/gcc/combine.c:5720 0x14c49d4 try_combine /repo/gcc-trunk/gcc/combine.c:3479 0x14cd56a combine_instructions /repo/gcc-trunk/gcc/combine.c:1442 0x14cd56a rest_of_handle_combine /repo/gcc-trunk/gcc/combine.c:15059 0x14cd56a execute /repo/gcc-trunk/gcc/combine.c:15104 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. The failing code is: 1643: case ZERO_EXTRACT: 1644: /* This is an SImode shift. */ 1645: if (outer_code == SET && (INTVAL (XEXP (x, 2)) > 0) 1646: && (INTVAL (XEXP (x, 1)) + INTVAL (XEXP (x, 2)) == 32)) 1647: { 1648: *total = COSTS_N_INSNS (SINGLE_SHIFT_COST); 1649: return true; 1650: } 1651: return false; $ riscv64-unknown-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-20200120111030-92ce93c743b-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/10.0.1/lto-wrapper Target: riscv64-unknown-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 --with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu --with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld --with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-20200120111030-92ce93c743b-checking-yes-rtl-df-extra-riscv64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.0.1 20200120 (experimental) (GCC)