public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Vladimir Makarov <vmakarov@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-9401] [PR113790][LRA]: Fixing LRA ICE on riscv64
Date: Fri,  8 Mar 2024 19:53:44 +0000 (GMT)	[thread overview]
Message-ID: <20240308195344.4D7F8385E012@sourceware.org> (raw)

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

commit r14-9401-gcebbaa2a84586a7345837f74a53b7a0263bf29ee
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Fri Mar 8 14:48:33 2024 -0500

    [PR113790][LRA]: Fixing LRA ICE on riscv64
    
      LRA failed to consider all insn alternatives when non-reload pseudo
    did not get a hard register.  This resulted in failure to generate
    code by LRA.  The patch fixes this problem.
    
    gcc/ChangeLog:
    
            PR target/113790
            * lra-assigns.cc (assign_by_spills): Set up all_spilled_pseudos
            for non-reload pseudo too.

Diff:
---
 gcc/lra-assigns.cc | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/gcc/lra-assigns.cc b/gcc/lra-assigns.cc
index d1b2b35ffc9..7dfa6f70941 100644
--- a/gcc/lra-assigns.cc
+++ b/gcc/lra-assigns.cc
@@ -1430,13 +1430,19 @@ assign_by_spills (void)
 	    hard_regno = spill_for (regno, &all_spilled_pseudos, iter == 1);
 	  if (hard_regno < 0)
 	    {
-	      if (reload_p) {
-		/* Put unassigned reload pseudo first in the
-		   array.  */
-		regno2 = sorted_pseudos[nfails];
-		sorted_pseudos[nfails++] = regno;
-		sorted_pseudos[i] = regno2;
-	      }
+	      if (reload_p)
+		{
+		  /* Put unassigned reload pseudo first in the array.  */
+		  regno2 = sorted_pseudos[nfails];
+		  sorted_pseudos[nfails++] = regno;
+		  sorted_pseudos[i] = regno2;
+		}
+	      else
+		{
+		  /* Consider all alternatives on the next constraint
+		     subpass.  */
+		  bitmap_set_bit (&all_spilled_pseudos, regno);
+		}
 	    }
 	  else
 	    {

                 reply	other threads:[~2024-03-08 19:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240308195344.4D7F8385E012@sourceware.org \
    --to=vmakarov@gcc.gnu.org \
    --cc=gcc-cvs@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).