diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2019-09-30 16:20:44 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2019-09-30 16:20:44 +0000 |
commit | a4dfaad2e5594d871fe00a1116005e28f95d644e (patch) | |
tree | 3233d2242a991f2f03d526e2a5f4919768029e6c | |
parent | c1b582720a39c3cb944aaff0298f721cdd034e3f (diff) | |
download | gcc-a4dfaad2e5594d871fe00a1116005e28f95d644e.zip gcc-a4dfaad2e5594d871fe00a1116005e28f95d644e.tar.gz gcc-a4dfaad2e5594d871fe00a1116005e28f95d644e.tar.bz2 |
Remove global call sets: gcse.c
This is another case in which we can conservatively treat partial
kills as full kills. Again this is in principle 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/
* gcse.c: Include function-abi.h.
(compute_hash_table_work): Use insn_callee_abi to get the ABI of
the call insn target. Invalidate partially call-clobbered
registers as well as fully call-clobbered ones.
From-SVN: r276323
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/gcse.c | 10 |
2 files changed, 15 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9d8b083..1b1c31c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2019-09-30 Richard Sandiford <richard.sandiford@arm.com> + * gcse.c: Include function-abi.h. + (compute_hash_table_work): Use insn_callee_abi to get the ABI of + the call insn target. Invalidate partially call-clobbered + registers as well as fully call-clobbered ones. + +2019-09-30 Richard Sandiford <richard.sandiford@arm.com> + * function.c (aggregate_value_p): Work out which ABI the function is using before testing which registers are at least partly preserved by a call. @@ -160,6 +160,7 @@ along with GCC; see the file COPYING3. If not see #include "dbgcnt.h" #include "gcse.h" #include "gcse-common.h" +#include "function-abi.h" /* We support GCSE via Partial Redundancy Elimination. PRE optimizations are a superset of those done by classic GCSE. @@ -1528,8 +1529,13 @@ compute_hash_table_work (struct gcse_hash_table_d *table) if (CALL_P (insn)) { hard_reg_set_iterator hrsi; - EXECUTE_IF_SET_IN_HARD_REG_SET (regs_invalidated_by_call, - 0, regno, hrsi) + + /* We don't track modes of hard registers, so we need + to be conservative and assume that partial kills + are full kills. */ + HARD_REG_SET callee_clobbers + = insn_callee_abi (insn).full_and_partial_reg_clobbers (); + EXECUTE_IF_SET_IN_HARD_REG_SET (callee_clobbers, 0, regno, hrsi) record_last_reg_set_info (insn, regno); if (! RTL_CONST_OR_PURE_CALL_P (insn) |