public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "iwfinlay at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/108284] New: RISCV 32-bit Zbs extension - ICE: in extract_insn, at recog.cc:2791
Date: Wed, 04 Jan 2023 15:38:36 +0000	[thread overview]
Message-ID: <bug-108284-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             reply	other threads:[~2023-01-04 15:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04 15:38 iwfinlay at gmail dot com [this message]
2023-01-04 17:05 ` [Bug target/108284] " pinskia at gcc dot gnu.org
2023-01-04 17:07 ` pinskia at gcc dot gnu.org
2023-01-04 17:14 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-108284-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).