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/111634] RISC-V vector: ICE RTL check: expected code 'reg', have 'lo_sum' in rhs_regno, at rtl.h:1934
Date: Sat, 07 Oct 2023 04:57:43 +0000	[thread overview]
Message-ID: <bug-111634-4-AHx70LnvyC@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111634-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pan Li <panli@gcc.gnu.org>:

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

commit r14-4443-ga809a556dc0792a34fca7b754ff96ea3ea7d1e7f
Author: Pan Li <pan2.li@intel.com>
Date:   Sat Oct 7 12:39:14 2023 +0800

    RISC-V: Bugfix for legitimize address PR/111634

    Given we have RTL as below.

    (plus:DI (mult:DI (reg:DI 138 [ g.4_6 ])
                      (const_int 8 [0x8]))
             (lo_sum:DI (reg:DI 167)
                        (symbol_ref:DI ("f") [flags 0x86] <var_decl
0x7fa96ea1cc60 f>)
    ))

    When handling (plus (plus (mult (a) (mem_shadd_constant)) (fp)) (C)) case,
    the fp will be the lo_sum operand as above. We have assumption that the fp
    is reg but actually not here. It will have ICE when building with option
    --enable-checking=rtl.

    This patch would like to fix it by adding the REG_P to ensure the operand
    is a register. The test case gcc/testsuite/gcc.dg/pr109417.c covered this
    fix when build with --enable-checking=rtl.

            PR target/111634

    gcc/ChangeLog:

            * config/riscv/riscv.cc (riscv_legitimize_address): Ensure
            object is a REG before extracting its' REGNO.

    Signed-off-by: Pan Li <pan2.li@intel.com>

  parent reply	other threads:[~2023-10-07  4:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28 18:59 [Bug target/111634] New: " patrick at rivosinc dot com
2023-09-28 19:01 ` [Bug target/111634] " patrick at rivosinc dot com
2023-10-07  4:57 ` cvs-commit at gcc dot gnu.org [this message]
2023-10-07  9:03 ` patrick at rivosinc dot com

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-111634-4-AHx70LnvyC@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).