+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
}
}
- /* 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;