diff options
author | Dragan Mladjenovic <dmladjenovic@wavecomp.com> | 2019-07-09 21:20:57 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2019-07-09 15:20:57 -0600 |
commit | 4b1a1d981869346f5b98f78fa1f31acb58535932 (patch) | |
tree | 7d51eb38eeef454a5b3d8b681f3549ff818f684e /gcc/cfgcleanup.c | |
parent | 4faba5c3bc37c0bfceec6b254d76c5d0b3e2fe8b (diff) | |
download | gcc-4b1a1d981869346f5b98f78fa1f31acb58535932.zip gcc-4b1a1d981869346f5b98f78fa1f31acb58535932.tar.gz gcc-4b1a1d981869346f5b98f78fa1f31acb58535932.tar.bz2 |
cfgcleanup.c (old_insns_match_p): Check if used hard regs set is equal for both call instructions.
2019-07-09 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
* cfgcleanup.c (old_insns_match_p): Check if used hard regs set is equal
for both call instructions.
2019-07-09 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
* gcc.target/mips/cfgcleanup-jalr1.c: New test.
* gcc.target/mips/cfgcleanup-jalr2.c: New test.
* gcc.target/mips/cfgcleanup-jalr3.c: New test.
From-SVN: r273314
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r-- | gcc/cfgcleanup.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 992912c..fca3a08 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -53,6 +53,7 @@ along with GCC; see the file COPYING3. If not see #include "dce.h" #include "dbgcnt.h" #include "rtl-iter.h" +#include "regs.h" #define FORWARDER_BLOCK_P(BB) ((BB)->flags & BB_FORWARDER_BLOCK) @@ -1224,6 +1225,14 @@ old_insns_match_p (int mode ATTRIBUTE_UNUSED, rtx_insn *i1, rtx_insn *i2) } } } + + HARD_REG_SET i1_used, i2_used; + + get_call_reg_set_usage (i1, &i1_used, call_used_reg_set); + get_call_reg_set_usage (i2, &i2_used, call_used_reg_set); + + if (!hard_reg_set_equal_p (i1_used, i2_used)) + return dir_none; } /* If both i1 and i2 are frame related, verify all the CFA notes |