public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: "juzhe.zhong@rivai.ai" <juzhe.zhong@rivai.ai>,
	schwab <schwab@linux-m68k.org>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	"monk.chiang" <monk.chiang@sifive.com>,
	"kito.cheng" <kito.cheng@gmail.com>, jiawei <jiawei@iscas.ac.cn>
Subject: Re: [PATCH] RISC-V: Add RVV registers register spilling
Date: Mon, 21 Nov 2022 08:26:37 -0700	[thread overview]
Message-ID: <1952901d-e16d-c626-d3a7-f95398c92e9e@gmail.com> (raw)
In-Reply-To: <833F883F0CA80822+20221121172503206590116@rivai.ai>

[-- Attachment #1: Type: text/plain, Size: 556 bytes --]


On 11/21/22 02:25, juzhe.zhong@rivai.ai wrote:
> https://gcc.gnu.org/pipermail/gcc-patches/2022-November/606523.html
> This patch obviously didn't include scalable size frame.
> So it ICE in offset = cfun->machine->frame.gp_sp_offset.to_constant ();
> We can't directly use to_constant if the frame is a scalable.
> Please fix it or revert it. Thanks

We probably just need to reject everything in 
riscv_get_setparate_components if the offset isn't constant. Something 
like the attached patch (untested) might be enough to resolve the problem.


Jeff



[-- Attachment #2: P --]
[-- Type: text/plain, Size: 554 bytes --]

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 7ec4ce97e6c..7bfc0e9f595 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -5340,7 +5340,8 @@ riscv_get_separate_components (void)
   bitmap_clear (components);
 
   if (riscv_use_save_libcall (&cfun->machine->frame)
-      || cfun->machine->interrupt_handler_p)
+      || cfun->machine->interrupt_handler_p
+      || !cfun->machine->frame.gp_sp_offset.is_constant ())
     return components;
 
   offset = cfun->machine->frame.gp_sp_offset.to_constant ();

  reply	other threads:[~2022-11-21 15:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-06  8:56 juzhe.zhong
2022-11-11  8:17 ` Kito Cheng
2022-11-20  9:24 ` Andreas Schwab
2022-11-21  8:38   ` juzhe.zhong
     [not found]   ` <20221121163829759542114@rivai.ai>
2022-11-21  9:25     ` juzhe.zhong
2022-11-21 15:26       ` Jeff Law [this message]
2022-11-22  1:42         ` jiawei

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=1952901d-e16d-c626-d3a7-f95398c92e9e@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jiawei@iscas.ac.cn \
    --cc=juzhe.zhong@rivai.ai \
    --cc=kito.cheng@gmail.com \
    --cc=monk.chiang@sifive.com \
    --cc=schwab@linux-m68k.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).