Commit 43d0b501 by Jakub Jelinek Committed by Jakub Jelinek

re PR target/78614 (ICE error: invalid rtl sharing found in the insn…

re PR target/78614 (ICE error: invalid rtl sharing found in the insn (verify_rtx_sharing) gcc/emit-rtl.c:2743)

	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.

From-SVN: r243099
parent d9b2d86c
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
......@@ -27174,6 +27174,7 @@ rs6000_frame_related (rtx_insn *insn, rtx reg, HOST_WIDE_INT val,
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)
......@@ -27185,6 +27186,7 @@ rs6000_frame_related (rtx_insn *insn, rtx reg, HOST_WIDE_INT val,
{
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)
......@@ -27207,8 +27209,7 @@ rs6000_frame_related (rtx_insn *insn, rtx reg, HOST_WIDE_INT val,
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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment