aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir N. Makarov <vmakarov@redhat.com>2024-03-08 14:48:33 -0500
committerVladimir N. Makarov <vmakarov@redhat.com>2024-03-08 14:49:01 -0500
commitcebbaa2a84586a7345837f74a53b7a0263bf29ee (patch)
tree49da9aabffd2ce9a01054eea036c59d00b790cf7
parent0e850eff58539fb79483664962fac6c46d65c79d (diff)
downloadgcc-cebbaa2a84586a7345837f74a53b7a0263bf29ee.zip
gcc-cebbaa2a84586a7345837f74a53b7a0263bf29ee.tar.gz
gcc-cebbaa2a84586a7345837f74a53b7a0263bf29ee.tar.bz2
[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.
-rw-r--r--gcc/lra-assigns.cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/gcc/lra-assigns.cc b/gcc/lra-assigns.cc
index d1b2b35..7dfa6f7 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
{