public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jlaw@ventanamicro.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: [committed][RISC-V] Fix recent rvv/base/spill testcase failures
Date: Tue, 22 Nov 2022 16:20:58 -0700	[thread overview]
Message-ID: <293c6900-a6b8-9bcb-9752-5f41554e80c5@ventanamicro.com> (raw)

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

As Jaiwei noted, many (all?) of the rvv/base/spill tests started failing 
after the introduction of shrink-wrapping.


The core issue is we're expecting the frame to have a constant size, but 
it doesn't.  So when using the to_constant method we abort.


The safest thing to do is to set no shrink-wrapping components when the 
frame size is not fixed.  We might be able to do better later -- iff we 
know the offset to the GPRs/FPRs is fixed and fits into the appropriate 
number of bits.


Bootstrapped and regression tested (C-only) on riscv64-linux-gnu.  As 
expected, it fixes a bucketload of failures in rvv/base/spill-*.c.


Installed on the trunk,

Jeff

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

commit ca73d4c80ea06087d9dd22594e5670bb15e21066
Author: Jeff Law <jeffreyalaw@gmail.com>
Date:   Tue Nov 22 18:12:45 2022 -0500

    Fix recent rvv/base/spill testcase failures
    
    he core issue is we're expecting the frame to have a constant size, but it
    doesn't.  So when using the to_constant method we abort.
    
    The safest thing to do is to set no shrink-wrapping components when the
    frame size is not fixed.  We might be able to do better later -- iff we
    know the offset to the GPRs/FPRs is fixed and fits into the appropriate
    number of bits.
    
    Bootstrapped and regression tested (C-only) on riscv64-linux-gnu.  As
    expected, it fixes a bucketload of failures in rvv/base/spill-*.c.
    
    gcc/
            * config/riscv/riscv.cc (riscv_get_separate_components): Do not
            do shrink-wrapping for a frame with a variable size.

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-22 23:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 23:20 Jeff Law [this message]
2022-11-23  3:39 ` Kito Cheng

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=293c6900-a6b8-9bcb-9752-5f41554e80c5@ventanamicro.com \
    --to=jlaw@ventanamicro.com \
    --cc=gcc-patches@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).