public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108284] New: RISCV 32-bit Zbs extension - ICE: in extract_insn, at recog.cc:2791
@ 2023-01-04 15:38 iwfinlay at gmail dot com
  2023-01-04 17:05 ` [Bug target/108284] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: iwfinlay at gmail dot com @ 2023-01-04 15:38 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/108284] RISCV 32-bit Zbs extension - ICE: in extract_insn, at recog.cc:2791
  2023-01-04 15:38 [Bug c++/108284] New: RISCV 32-bit Zbs extension - ICE: in extract_insn, at recog.cc:2791 iwfinlay at gmail dot com
@ 2023-01-04 17:05 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-04 17:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108284

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |target
           Keywords|                            |ice-on-valid-code

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is fixed on the trunk for gcc 13
Backporting the patches is doable but since zbs was a new feature in gcc 12, I
decided not to do the backport and say it was broken for 32bit when I did the
patches.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/108284] RISCV 32-bit Zbs extension - ICE: in extract_insn, at recog.cc:2791
  2023-01-04 15:38 [Bug c++/108284] New: RISCV 32-bit Zbs extension - ICE: in extract_insn, at recog.cc:2791 iwfinlay at gmail dot com
  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
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-04 17:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108284

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Also the new warning is not incorrect. You need to set a parameter to get be
able to access memory location in the lower 4k because gcc assumes that that
lower 4k was just a mistake and an offset from a null pointer.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/108284] RISCV 32-bit Zbs extension - ICE: in extract_insn, at recog.cc:2791
  2023-01-04 15:38 [Bug c++/108284] New: RISCV 32-bit Zbs extension - ICE: in extract_insn, at recog.cc:2791 iwfinlay at gmail dot com
  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
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-04 17:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108284

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 106532.

The fix for the warning option is --param=min-pagesize=0 (see PR  99578).

*** This bug has been marked as a duplicate of bug 106532 ***

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-04 17:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-04 15:38 [Bug c++/108284] New: RISCV 32-bit Zbs extension - ICE: in extract_insn, at recog.cc:2791 iwfinlay at gmail dot com
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

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).