https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91957

--- Comment #3 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> 
---
Author: rsandifo
Date: Wed Oct  2 07:37:10 2019
New Revision: 276440

URL: https://gcc.gnu.org/viewcvs?rev=276440&root=gcc&view=rev
Log:
[LRA] Don't make eliminable registers live (PR91957)

One effect of https://gcc.gnu.org/ml/gcc-patches/2019-09/msg00802.html
was to strengthen the sanity check in lra_assigns so that it checks
whether reg_renumber is consistent with the whole conflict set.
This duly tripped on csky for a pseudo that had been allocated
to the eliminated frame pointer.  (csky doesn't have a separate
hard frame pointer.)

lra-lives uses:

/* Set of hard regs (except eliminable ones) currently live.  */
static HARD_REG_SET hard_regs_live;

to track the set of live directly-referenced hard registers, and it
correctly implements the exclusion when setting up the initial set:

  hard_regs_live &= ~eliminable_regset;

But later calls to make_hard_regno_live and make_hard_regno_dead
would process eliminable registers like other registers, recording
conflicts for them and potentially making them live.  (Note that
after r266086, make_hard_regno_dead adds conflicts for registers
that are already marked dead.)  I think this would have had the
effect of pessimising targets without a separate hard frame pointer.

2019-10-02  Richard Sandiford  <richard.sandif...@arm.com>

gcc/
        PR middle-end/91957
        * lra-lives.c (make_hard_regno_dead): Don't record conflicts for
        eliminable registers.
        (make_hard_regno_live): Likewise, and don't make them live.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lra-lives.c

Reply via email to