public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/109092] [13 Regression] ICE: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:1932 when building libgcc on riscv64
Date: Mon, 22 Jan 2024 12:55:29 +0000	[thread overview]
Message-ID: <bug-109092-4-UXrCz1OeQI@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109092-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Lehua Ding <lhtin@gcc.gnu.org>:

https://gcc.gnu.org/g:f625c017e60b6e05675b7d6280f2c7677ce691c3

commit r14-8333-gf625c017e60b6e05675b7d6280f2c7677ce691c3
Author: Juzhe-Zhong <juzhe.zhong@rivai.ai>
Date:   Mon Jan 22 17:05:07 2024 +0800

    RISC-V: Fix regressions due to 86de9b66480b710202a2898cf513db105d8c432f

    This patch fixes the recent regression:

    FAIL: gcc.dg/torture/float32-tg-2.c   -O1  (internal compiler error: in
reg_or_subregno, at jump.cc:1895)
    FAIL: gcc.dg/torture/float32-tg-2.c   -O1  (test for excess errors)
    FAIL: gcc.dg/torture/float32-tg-2.c   -O2  (internal compiler error: in
reg_or_subregno, at jump.cc:1895)
    FAIL: gcc.dg/torture/float32-tg-2.c   -O2  (test for excess errors)
    FAIL: gcc.dg/torture/float32-tg-2.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  (internal compiler error: in reg_or_subregno, at
jump.cc:1895)
    FAIL: gcc.dg/torture/float32-tg-2.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  (test for excess errors)
    FAIL: gcc.dg/torture/float32-tg-2.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  (internal compiler error: in reg_or_subregno, at
jump.cc:1895)
    FAIL: gcc.dg/torture/float32-tg-2.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  (test for excess errors)
    FAIL: gcc.dg/torture/float32-tg-2.c   -O3 -g  (internal compiler error: in
reg_or_subregno, at jump.cc:1895)
    FAIL: gcc.dg/torture/float32-tg-2.c   -O3 -g  (test for excess errors)
    FAIL: gcc.dg/torture/float32-tg-2.c   -Os  (internal compiler error: in
reg_or_subregno, at jump.cc:1895)
    FAIL: gcc.dg/torture/float32-tg-2.c   -Os  (test for excess errors)
    FAIL: gcc.dg/torture/float32-tg.c   -O1  (internal compiler error: in
reg_or_subregno, at jump.cc:1895)
    FAIL: gcc.dg/torture/float32-tg.c   -O1  (test for excess errors)
    FAIL: gcc.dg/torture/float32-tg.c   -O2  (internal compiler error: in
reg_or_subregno, at jump.cc:1895)
    FAIL: gcc.dg/torture/float32-tg.c   -O2  (test for excess errors)
    FAIL: gcc.dg/torture/float32-tg.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  (internal compiler error: in reg_or_subregno, at
jump.cc:1895)
    FAIL: gcc.dg/torture/float32-tg.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  (test for excess errors)
    FAIL: gcc.dg/torture/float32-tg.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  (internal compiler error: in reg_or_subregno, at
jump.cc:1895)
    FAIL: gcc.dg/torture/float32-tg.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  (test for excess errors)
    FAIL: gcc.dg/torture/float32-tg.c   -O3 -g  (internal compiler error: in
reg_or_subregno, at jump.cc:1895)
    FAIL: gcc.dg/torture/float32-tg.c   -O3 -g  (test for excess errors)
    FAIL: gcc.dg/torture/float32-tg.c   -Os  (internal compiler error: in
reg_or_subregno, at jump.cc:1895)
    FAIL: gcc.dg/torture/float32-tg.c   -Os  (test for excess errors)
    FAIL: gcc.dg/torture/pr48124-4.c   -O1  (internal compiler error: in
reg_or_subregno, at jump.cc:1895)
    FAIL: gcc.dg/torture/pr48124-4.c   -O1  (test for excess errors)
    FAIL: gcc.dg/torture/pr48124-4.c   -O2  (internal compiler error: in
reg_or_subregno, at jump.cc:1895)
    FAIL: gcc.dg/torture/pr48124-4.c   -O2  (test for excess errors)
    FAIL: gcc.dg/torture/pr48124-4.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  (internal compiler error: in reg_or_subregno, at
jump.cc:1895)
    FAIL: gcc.dg/torture/pr48124-4.c   -O2 -flto -fno-use-linker-plugin
-flto-partition=none  (test for excess errors)
    FAIL: gcc.dg/torture/pr48124-4.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  (internal compiler error: in reg_or_subregno, at
jump.cc:1895)
    FAIL: gcc.dg/torture/pr48124-4.c   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  (test for excess errors)
    FAIL: gcc.dg/torture/pr48124-4.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (internal compiler error: in
reg_or_subregno, at jump.cc:1895)
    FAIL: gcc.dg/torture/pr48124-4.c   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (test for excess errors)
    FAIL: gcc.dg/torture/pr48124-4.c   -O3 -g  (internal compiler error: in
reg_or_subregno, at jump.cc:1895)
    FAIL: gcc.dg/torture/pr48124-4.c   -O3 -g  (test for excess errors)
    FAIL: gcc.dg/torture/pr48124-4.c   -Os  (internal compiler error: in
reg_or_subregno, at jump.cc:1895)
    FAIL: gcc.dg/torture/pr48124-4.c   -Os  (test for excess errors)

    due to commit 86de9b66480b710202a2898cf513db105d8c432f.

    The root cause is register_operand and reg_or_subregno are consistent so we
reach the assertion fail.

    We shouldn't worry about subreg:...VL_REGNUM since it's impossible that we
can have such situation,
    that is, we only have (set (reg) (reg:VL_REGNUM)) which generate "csrr vl"
ASM for first fault load instructions (vleff).
    So, using REG_P and REGNO must be totally solid and robostic.

    Since we don't allow VL_RENUM involved into register allocation and we
don't have such constraint, we always use this
    following pattern to generate "csrr vl" ASM:

    (define_insn "read_vlsi"
      [(set (match_operand:SI 0 "register_operand" "=r")
            (reg:SI VL_REGNUM))]
      "TARGET_VECTOR"
      "csrr\t%0,vl"
      [(set_attr "type" "rdvl")
       (set_attr "mode" "SI")])

    So the check in riscv.md is to disallow such situation fall into move
pattern in riscv.md

    Tested on both RV32/RV64 no regression.

            PR target/109092

    gcc/ChangeLog:

            * config/riscv/riscv.md: Use reg instead of subreg.

    gcc/testsuite/ChangeLog:

            * gcc.target/riscv/rvv/base/pr109092.c: New test.

      parent reply	other threads:[~2024-01-22 12:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 17:32 [Bug rtl-optimization/109092] New: " zsojka at seznam dot cz
2023-03-10 17:37 ` [Bug target/109092] " pinskia at gcc dot gnu.org
2023-03-13  8:52 ` rguenth at gcc dot gnu.org
2023-03-13 10:03 ` ubizjak at gmail dot com
2023-03-13 17:01 ` jakub at gcc dot gnu.org
2023-03-14 18:12 ` law at gcc dot gnu.org
2023-03-14 18:30 ` ubizjak at gmail dot com
2023-03-15  1:53 ` juzhe.zhong at rivai dot ai
2023-03-17  9:50 ` cvs-commit at gcc dot gnu.org
2023-03-27  7:44 ` pinskia at gcc dot gnu.org
2024-01-22 12:55 ` cvs-commit at gcc dot gnu.org [this message]

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-109092-4-UXrCz1OeQI@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).