Hi!
This fixes another fallout of the recent change in the pattern matching,
which makes LRA choose a different alternative for this insn:
(insn 48 21 23 3 (set (reg/f:SI 102 sfp)
(reg/f:SI 7 r7)) 808 {*thumb1_movsi_insn}
(nil))
This is replaced as a special case to set((sfp)(r7-sfp_fp_elim_off)).
LRA choses thumb1_addsi3, alt 2 instead of alt 1, because sfp != r7,
while elimination of sfp->r7.
Unfortunately the insn gets a REG_EQUAL note temporarily attached,
which is spoiled by the elimination, so the reg-note is no longer
usable, and the instruction gets deleted in the final transformation.
So, as it looks like, this was a latent bug, as it is not OK to have
an alias on any RTX, except on a simple REG.
Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
Is it OK for trunk?
Thanks
Bernd.
2016-09-26 Bernd Edlinger <[email protected]>
PR rlt-optimization/77714
* lra-eliminations.c (eliminate_regs_in_insn): Avoid alias on
REG_EQUAL note.
Index: gcc/lra-eliminations.c
===================================================================
--- gcc/lra-eliminations.c (revision 240471)
+++ gcc/lra-eliminations.c (working copy)
@@ -981,7 +981,7 @@ eliminate_regs_in_insn (rtx_insn *insn, bool repla
}
lra_update_insn_recog_data (insn);
/* Add offset note for future updates. */
- add_reg_note (insn, REG_EQUAL, src);
+ add_reg_note (insn, REG_EQUAL, copy_rtx (src));
return;
}
}