public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Juzhe-Zhong <juzhe.zhong@rivai.ai>, gcc-patches@gcc.gnu.org
Cc: kito.cheng@gmail.com, kito.cheng@sifive.com, rdapp.gcc@gmail.com
Subject: Re: [PATCH] RISC-V: Fix incorrect mode tieable which cause ICE in RA[PR111296]
Date: Wed, 6 Sep 2023 08:00:59 -0600	[thread overview]
Message-ID: <1349083b-1483-4f5d-82e7-178fb3154322@gmail.com> (raw)
In-Reply-To: <20230906094759.4040203-1-juzhe.zhong@rivai.ai>



On 9/6/23 03:47, Juzhe-Zhong wrote:
> This patch fix incorrect mode tieable between DI and V2SI which cause ICE
> in RA.
> 
> 	PR target/111296
> 
> gcc/ChangeLog:
> 
> 	* config/riscv/riscv.cc (riscv_modes_tieable_p): Fix bug.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* g++.target/riscv/rvv/base/pr111296.C: New test.

> 
> ---
>   gcc/config/riscv/riscv.cc                      |  7 +++++++
>   .../g++.target/riscv/rvv/base/pr111296.C       | 18 ++++++++++++++++++
>   2 files changed, 25 insertions(+)
>   create mode 100644 gcc/testsuite/g++.target/riscv/rvv/base/pr111296.C
> 
> diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
> index 228515acc1f..2c0c4c2f3ae 100644
> --- a/gcc/config/riscv/riscv.cc
> +++ b/gcc/config/riscv/riscv.cc
> @@ -7648,6 +7648,13 @@ riscv_hard_regno_mode_ok (unsigned int regno, machine_mode mode)
>   static bool
>   riscv_modes_tieable_p (machine_mode mode1, machine_mode mode2)
>   {
> +  /* We don't allow different REG_CLASS modes tieable since it
> +     will cause ICE in register allocation (RA).
> +     E.g. V2SI and DI are not tieable.  */
> +  if (riscv_v_ext_mode_p (mode1) && !riscv_v_ext_mode_p (mode2))
> +    return false;
> +  else if (riscv_v_ext_mode_p (mode2) && !riscv_v_ext_mode_p (mode1))
> +    return false;
Isn't this just
if (riscv_v_ext_mode_p (mode1) != riscv_v_ext_mode_p (mode2))

OK with that change.

jeff

      reply	other threads:[~2023-09-06 14:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06  9:47 Juzhe-Zhong
2023-09-06 14:00 ` Jeff Law [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=1349083b-1483-4f5d-82e7-178fb3154322@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=juzhe.zhong@rivai.ai \
    --cc=kito.cheng@gmail.com \
    --cc=kito.cheng@sifive.com \
    --cc=rdapp.gcc@gmail.com \
    /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).