diff options
author | Tom de Vries <tom@codesourcery.com> | 2014-10-17 06:36:35 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2014-10-17 06:36:35 +0000 |
commit | 8c8fe66309a90e2fffd1515650321ca934857357 (patch) | |
tree | d324360c0d59e9d4b01b8bc75b244c5f1e5d7307 | |
parent | 5dad161975e0e5362ecb554e08d4a94a2c4b3922 (diff) | |
download | gcc-8c8fe66309a90e2fffd1515650321ca934857357.zip gcc-8c8fe66309a90e2fffd1515650321ca934857357.tar.gz gcc-8c8fe66309a90e2fffd1515650321ca934857357.tar.bz2 |
Handle copy cycles in pass_cprop_hardreg
2014-10-17 Tom de Vries <tom@codesourcery.com>
PR rtl-optimization/61605
* regcprop.c (copyprop_hardreg_forward_1): Add copy_p and noop_p. Don't
notice stores for noops. Don't regard noops as copies.
From-SVN: r216364
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/regcprop.c | 19 |
2 files changed, 20 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6b6f696..af30205 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-10-17 Tom de Vries <tom@codesourcery.com> + + PR rtl-optimization/61605 + * regcprop.c (copyprop_hardreg_forward_1): Add copy_p and noop_p. Don't + notice stores for noops. Don't regard noops as copies. + 2014-10-17 Uros Bizjak <ubizjak@gmail.com> * config/i386/cpuid.h (__cpuid): Remove definitions that handle %ebx diff --git a/gcc/regcprop.c b/gcc/regcprop.c index 7035a84..015366b 100644 --- a/gcc/regcprop.c +++ b/gcc/regcprop.c @@ -1047,12 +1047,21 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd) } } - /* Notice stores. */ - note_stores (PATTERN (insn), kill_set_value, &ksvd); + bool copy_p = (set + && REG_P (SET_DEST (set)) + && REG_P (SET_SRC (set))); + bool noop_p = (copy_p + && rtx_equal_p (SET_DEST (set), SET_SRC (set))); - /* Notice copies. */ - if (set && REG_P (SET_DEST (set)) && REG_P (SET_SRC (set))) - copy_value (SET_DEST (set), SET_SRC (set), vd); + if (!noop_p) + { + /* Notice stores. */ + note_stores (PATTERN (insn), kill_set_value, &ksvd); + + /* Notice copies. */ + if (copy_p) + copy_value (SET_DEST (set), SET_SRC (set), vd); + } if (insn == BB_END (bb)) break; |