diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-09-30 16:20:19 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-09-30 16:20:19 +0000 |
commit | 212b7076eec027d212e1badb9cb5a9db4b62ab50 (patch) | |
tree | 438802bf43b290eac420cfb6f0571e80e3e40f75 /gcc/combine.c | |
parent | 43b484fbf281553353c6ef55ff0871b222579004 (diff) | |
download | gcc-212b7076eec027d212e1badb9cb5a9db4b62ab50.zip gcc-212b7076eec027d212e1badb9cb5a9db4b62ab50.tar.gz gcc-212b7076eec027d212e1badb9cb5a9db4b62ab50.tar.bz2 |
Remove global call sets: combine.c
There shouldn't be many cases in which a useful hard register is
live across a call before RA, so we might as well keep things simple
and invalidate partially-clobbered registers here, in case the values
they hold leak into the call-clobbered part. In principle this is
a bug fix for TARGET_HARD_REGNO_CALL_PART_CLOBBERED targets,
but in practice it probably doesn't make a difference.
2019-09-30 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* combine.c: Include function-abi.h.
(record_dead_and_set_regs): Use insn_callee_abi to get the ABI
of the target of call insns. Invalidate partially-clobbered
registers as well as fully-clobbered ones.
From-SVN: r276316
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 981e7b0..d200c5a 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -105,6 +105,7 @@ along with GCC; see the file COPYING3. If not see #include "valtrack.h" #include "rtl-iter.h" #include "print-rtl.h" +#include "function-abi.h" /* Number of attempts to combine instructions in this function. */ @@ -13464,11 +13465,21 @@ record_dead_and_set_regs (rtx_insn *insn) if (CALL_P (insn)) { + HARD_REG_SET callee_clobbers + = insn_callee_abi (insn).full_and_partial_reg_clobbers (); hard_reg_set_iterator hrsi; - EXECUTE_IF_SET_IN_HARD_REG_SET (regs_invalidated_by_call, 0, i, hrsi) + EXECUTE_IF_SET_IN_HARD_REG_SET (callee_clobbers, 0, i, hrsi) { reg_stat_type *rsp; + /* ??? We could try to preserve some information from the last + set of register I if the call doesn't actually clobber + (reg:last_set_mode I), which might be true for ABIs with + partial clobbers. However, it would be difficult to + update last_set_nonzero_bits and last_sign_bit_copies + to account for the part of I that actually was clobbered. + It wouldn't help much anyway, since we rarely see this + situation before RA. */ rsp = ®_stat[i]; rsp->last_set_invalid = 1; rsp->last_set = insn; |