]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[PR113790][LRA]: Fixing LRA ICE on riscv64
authorVladimir N. Makarov <vmakarov@redhat.com>
Fri, 8 Mar 2024 19:48:33 +0000 (14:48 -0500)
committerVladimir N. Makarov <vmakarov@redhat.com>
Fri, 8 Mar 2024 19:49:01 +0000 (14:49 -0500)
  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.

gcc/lra-assigns.cc

index d1b2b35ffc95d4c37e44ad8454e1f492f5c07621..7dfa6f70941ec554cf9321e577c7c57b9920e62b 100644 (file)
@@ -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
            {