[PR98777] LRA: Use preliminary created pseudo for in LRA elimination subpass
authorVladimir N. Makarov <vmakarov@redhat.com>
Thu, 21 Jan 2021 22:27:01 +0000 (17:27 -0500)
committerVladimir N. Makarov <vmakarov@redhat.com>
Thu, 21 Jan 2021 23:06:49 +0000 (18:06 -0500)
commit68ba1039c7daf0485b167fe199ed7e8031158091
tree8e772cc2843b097a3ce590403ed20d0b5b0e4032
parentefb6bc55a93a1b8a719e0dab344c0a21344a67a9
[PR98777] LRA: Use preliminary created pseudo for in LRA elimination subpass

LRA did not extend ira_reg_equiv after generation of a pseudo in
eliminate_regs_in_insn which might results in LRA crash.  It is better not
to extend ira_reg_equiv but to use preliminary generated pseudo.  The
patch implements it.

gcc/ChangeLog:

PR rtl-optimization/98777
* lra-int.h (lra_pmode_pseudo): New extern.
* lra.c (lra_pmode_pseudo): New global.
(lra): Set it up.
* lra-eliminations.c (eliminate_regs_in_insn): Use it.

gcc/testsuite/ChangeLog:

PR rtl-optimization/98777
* gcc.target/riscv/pr98777.c: New.
gcc/lra-eliminations.c
gcc/lra-int.h
gcc/lra.c
gcc/testsuite/gcc.target/riscv/pr98777.c [new file with mode: 0644]