https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108284
Bug ID: 108284 Summary: RISCV 32-bit Zbs extension - ICE: in extract_insn, at recog.cc:2791 Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: iwfinlay at gmail dot com Target Milestone: --- Created attachment 54188 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54188&action=edit Generated from -freport-bug Enabling the Zbs extension to get bit set/extract/clear instructions for some hardware register configuration triggered the error. However, the problem is just in forming the address constant below. auto d = *reinterpret_cast<volatile uint32_t *>(0x800); I randomly tried a few constants with one or two bits set. Switching to 64-bit compiles OK and generates sensible output using the bseti instruction. Previously, I was using GCC 10 with pre-release bitmanip extension. The new array subscript 0 warning seems incorrect too. Lastly, I notice an extra -march setting is present in the generated report: -march=rv32imfdv_zbs_zve32f_zve32x_zve64d_zve64f_zve64x_zvl128b_zvl32b_zvl64b I was setting the following: -march=rv32imv_zbs > riscv64-unknown-elf-g++ -v Using built-in specs. COLLECT_GCC=riscv64-unknown-elf-g++ COLLECT_LTO_WRAPPER=/opt/homebrew/Cellar/riscv-gnu-toolchain/main/libexec/gcc/riscv64-unknown-elf/12.2.0/lto-wrapper Target: riscv64-unknown-elf Configured with: /private/tmp/riscv-gnu-toolchain-20230102-54288-184l9sv/gcc/configure --target=riscv64-unknown-elf --prefix=/opt/homebrew/Cellar/riscv-gnu-toolchain/main --disable-shared --disable-threads --enable-languages=c,c++ --with-pkgversion=g2ee5e430018-dirty --with-system-zlib --enable-tls --with-newlib --with-sysroot=/opt/homebrew/Cellar/riscv-gnu-toolchain/main/riscv64-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-tm-clone-registry --src=/private/tmp/riscv-gnu-toolchain-20230102-54288-184l9sv/gcc --enable-multilib --with-abi=lp64d --with-arch=rv64imafdc --with-tune=rocket --with-isa-spec=2.2 'CFLAGS_FOR_TARGET=-Os -mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medany' Thread model: single Supported LTO compression algorithms: zlib zstd gcc version 12.2.0 (g2ee5e430018-dirty) CXX_FLAGS = -march=rv32imv_zbs -mabi=ilp32 -static -mcmodel=medany -std=c++20 -fno-exceptions -fno-asynchronous-unwind-tables -fno-use-cxa-atexit -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -Wall -Wextra -pedantic -Wno-error -O2 -freport-bug -save-temps