lra: Stop registers being incorrectly marked live v2 [PR92989]
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 19 Feb 2020 12:59:17 +0000 (12:59 +0000)
committerJeff Law <law@redhat.com>
Fri, 21 Feb 2020 20:32:59 +0000 (13:32 -0700)
commitd11676de2961d10c10b82f04da28254cb46ef645
tree804729188a878d8d4ccf352c9beecebc37303000
parent25f0909af87171395d9ee21cf2873f4d9b5ebc91
lra: Stop registers being incorrectly marked live v2 [PR92989]

This PR is about a case in which the clobbers at the start of
an EH receiver can lead to registers becoming unnecessarily
live in predecessor blocks.  My first attempt at fixing this
made sure that we update the bb liveness info based on the
real live set:

  http://gcc.gnu.org/g:e648e57efca6ce6d751ef8c2038608817b514fb4

But it turns out that the clobbered registers were also added to
the "gen" set of LRA's private liveness problem, where "gen" in
this context means "generates a requirement for a live value".
So the clobbered registers could still end up live via that
mechanism instead.

This patch therefore reverts the patch above and takes the other
approach floated in the original patch description: model the full
clobber by making the registers live and then dead again.

There's no specific need to revert the original patch, since the
code should no longer be sensitive to the order of the bb liveness
update and the modelling of the clobber.  But given that there's
no specific need to keep the original patch either, it seemed better
to restore the code to the more well-tested order.

Tested on aarch64-linux-gnu and x86_64-linux-gnu.  OK to install?

Richard

2020-02-19  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR rtl-optimization/PR92989
* lra-lives.c (process_bb_lives): Restore the original order
of the bb liveness update.  Call make_hard_regno_dead for each
register clobbered at the start of an EH receiver.
gcc/ChangeLog
gcc/lra-lives.c