+2016-09-22 Jan Hubicka <hubicka@ucw.cz>
+
+ * regcprop.c (copyprop_hardreg_forward_1): Remove noop moves.
+
2016-09-22 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* emit-rtl.c (next_cc0_user): Make argument type rtx_insn *.
}
set = single_set (insn);
+
+ /* Detect noop sets and remove them before processing side effects. */
+ if (set && REG_P (SET_DEST (set)) && REG_P (SET_SRC (set)))
+ {
+ unsigned int regno = REGNO (SET_SRC (set));
+ rtx r1 = find_oldest_value_reg (REGNO_REG_CLASS (regno),
+ SET_DEST (set), vd);
+ rtx r2 = find_oldest_value_reg (REGNO_REG_CLASS (regno),
+ SET_SRC (set), vd);
+ if (rtx_equal_p (r1 ? r1 : SET_DEST (set), r2 ? r2 : SET_SRC (set)))
+ {
+ bool last = insn == BB_END (bb);
+ fprintf (stderr, "Bingo\n");
+ delete_insn (insn);
+ if (last)
+ break;
+ continue;
+ }
+ }
+
extract_constrain_insn (insn);
preprocess_constraints (insn);
const operand_alternative *op_alt = which_op_alt ();
register in the same class. */
if (REG_P (SET_DEST (set)))
{
- new_rtx = find_oldest_value_reg (REGNO_REG_CLASS (regno), src, vd);
+ new_rtx = find_oldest_value_reg (REGNO_REG_CLASS (regno),
+ src, vd);
+
if (new_rtx && validate_change (insn, &SET_SRC (set), new_rtx, 0))
{
if (dump_file)