Commit 7959b94e by Jeff Law Committed by Jeff Law

rl78.c (insn_ok_now): Always re-recognize the insn if returning false.

	* config/rl78/rl78.c (insn_ok_now): Always re-recognize the insn
	if returning false.

From-SVN: r265505
parent b15e2802
2018-10-25 Jeff Law <law@redhat.com>
* config/rl78/rl78.c (insn_ok_now): Always re-recognize the insn
if returning false.
2018-10-25 Martin Sebor <msebor@redhat.com> 2018-10-25 Martin Sebor <msebor@redhat.com>
* doc/extend.texi (aligned): Expand attribute description. * doc/extend.texi (aligned): Expand attribute description.
...@@ -2736,19 +2736,32 @@ insn_ok_now (rtx_insn * insn) ...@@ -2736,19 +2736,32 @@ insn_ok_now (rtx_insn * insn)
if (GET_CODE (OP (i)) == MEM if (GET_CODE (OP (i)) == MEM
&& GET_MODE (XEXP (OP (i), 0)) == SImode && GET_MODE (XEXP (OP (i), 0)) == SImode
&& GET_CODE (XEXP (OP (i), 0)) != UNSPEC) && GET_CODE (XEXP (OP (i), 0)) != UNSPEC)
return false; goto not_ok;
return true; return true;
} }
} }
else
{ /* INSN is not OK as-is. It may not be recognized in real mode or
it might not have satisfied its constraints in real mode. Either
way it will require fixups.
It is vital we always re-recognize at this point as some insns
have fewer operands in real mode than virtual mode. If we do
not re-recognize, then the recog_data will refer to real mode
operands and we may read invalid data. Usually this isn't a
problem, but once in a while the data we read is bogus enough
to cause a segfault or other undesirable behavior. */
not_ok:
/* We need to re-recog the insn with virtual registers to get /* We need to re-recog the insn with virtual registers to get
the operands. */ the operands. */
INSN_CODE (insn) = -1;
cfun->machine->virt_insns_ok = 1; cfun->machine->virt_insns_ok = 1;
if (recog (pattern, insn, 0) > -1) if (recog (pattern, insn, 0) > -1)
{ {
extract_insn (insn); extract_insn (insn);
/* In theory this should always be true. */
if (constrain_operands (0, get_preferred_alternatives (insn))) if (constrain_operands (0, get_preferred_alternatives (insn)))
{ {
cfun->machine->virt_insns_ok = 0; cfun->machine->virt_insns_ok = 0;
...@@ -2761,13 +2774,6 @@ insn_ok_now (rtx_insn * insn) ...@@ -2761,13 +2774,6 @@ insn_ok_now (rtx_insn * insn)
debug_rtx (insn); debug_rtx (insn);
#endif #endif
gcc_unreachable (); gcc_unreachable ();
}
#if DEBUG_ALLOC
fprintf (stderr, "\033[31m");
debug_rtx (insn);
fprintf (stderr, "\033[0m");
#endif
return false; return false;
} }
......
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