+2016-12-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/78614
+ * config/rs6000/rs6000.c (rs6000_frame_related): Call
+ set_used_flags (pat) before any simplifications. Clear used flag on
+ PARALLEL copy. Don't guard add_reg_note call. Call
+ copy_rtx_if_shared on pat before storing it into
+ REG_FRAME_RELATED_EXPR.
+
2016-12-01 Alan Modra <amodra@gmail.com>
* gcc/config/rs6000/rs6000.c (insn_is_swappable_p): Properly
Call simplify_replace_rtx on the SETs rather than the whole insn
so as to leave the other stuff alone (for example USE of r12). */
+ set_used_flags (pat);
if (GET_CODE (pat) == SET)
{
if (repl)
{
pat = shallow_copy_rtx (pat);
XVEC (pat, 0) = shallow_copy_rtvec (XVEC (pat, 0));
+ RTX_FLAG (pat, used) = 0;
for (int i = 0; i < XVECLEN (pat, 0); i++)
if (GET_CODE (XVECEXP (pat, 0, i)) == SET)
gcc_unreachable ();
RTX_FRAME_RELATED_P (insn) = 1;
- if (repl || reg2)
- add_reg_note (insn, REG_FRAME_RELATED_EXPR, pat);
+ add_reg_note (insn, REG_FRAME_RELATED_EXPR, copy_rtx_if_shared (pat));
return insn;
}