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
This commit is contained in:
Jakub Jelinek 2016-12-01 08:56:49 +01:00 committed by Jakub Jelinek
parent d9b2d86c74
commit 43d0b501ee
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,12 @@
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

View File

@ -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;
}