Commit 0e0f87d4 by Steven Bosscher

emit-rtl.c (reset_insn_used_flags): New function.


	* emit-rtl.c (reset_insn_used_flags): New function.
	(reset_all_used_flags): Use it.
	(verify_insn_sharing): New function.
	(verify_rtl_sharing): Fix verification for SEQUENCEs.

From-SVN: r198053
parent 4c445590
2013-04-18 Steven Bosscher <steven@gcc.gnu.org>
* emit-rtl.c (reset_insn_used_flags): New function.
(reset_all_used_flags): Use it.
(verify_insn_sharing): New function.
(verify_rtl_sharing): Fix verification for SEQUENCEs.
2013-04-18 Jakub Jelinek <jakub@redhat.com> 2013-04-18 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/56984 PR tree-optimization/56984
...@@ -108,7 +115,7 @@ ...@@ -108,7 +115,7 @@
(pass_rtl_unroll_and_peel_loops): Same. (pass_rtl_unroll_and_peel_loops): Same.
(pass_rtl_doloop): Same. (pass_rtl_doloop): Same.
2013-04-16 Greta Yorsh <Greta.Yorsh at arm.com> 2013-04-16 Greta Yorsh <Greta.Yorsh@arm.com>
* config/arm/arm.c (emit_multi_reg_push): New declaration * config/arm/arm.c (emit_multi_reg_push): New declaration
for an existing function. for an existing function.
......
...@@ -2596,6 +2596,18 @@ verify_rtx_sharing (rtx orig, rtx insn) ...@@ -2596,6 +2596,18 @@ verify_rtx_sharing (rtx orig, rtx insn)
return; return;
} }
/* Reset used-flags for INSN. */
static void
reset_insn_used_flags (rtx insn)
{
gcc_assert (INSN_P (insn));
reset_used_flags (PATTERN (insn));
reset_used_flags (REG_NOTES (insn));
if (CALL_P (insn))
reset_used_flags (CALL_INSN_FUNCTION_USAGE (insn));
}
/* Go through all the RTL insn bodies and clear all the USED bits. */ /* Go through all the RTL insn bodies and clear all the USED bits. */
static void static void
...@@ -2606,28 +2618,30 @@ reset_all_used_flags (void) ...@@ -2606,28 +2618,30 @@ reset_all_used_flags (void)
for (p = get_insns (); p; p = NEXT_INSN (p)) for (p = get_insns (); p; p = NEXT_INSN (p))
if (INSN_P (p)) if (INSN_P (p))
{ {
reset_used_flags (PATTERN (p)); rtx pat = PATTERN (p);
reset_used_flags (REG_NOTES (p)); if (GET_CODE (pat) != SEQUENCE)
if (CALL_P (p)) reset_insn_used_flags (p);
reset_used_flags (CALL_INSN_FUNCTION_USAGE (p)); else
if (GET_CODE (PATTERN (p)) == SEQUENCE)
{ {
int i; gcc_assert (REG_NOTES (p) == NULL);
rtx q, sequence = PATTERN (p); for (int i = 0; i < XVECLEN (pat, 0); i++)
reset_insn_used_flags (XVECEXP (pat, 0, i));
for (i = 0; i < XVECLEN (sequence, 0); i++)
{
q = XVECEXP (sequence, 0, i);
gcc_assert (INSN_P (q));
reset_used_flags (PATTERN (q));
reset_used_flags (REG_NOTES (q));
if (CALL_P (q))
reset_used_flags (CALL_INSN_FUNCTION_USAGE (q));
}
} }
} }
} }
/* Verify sharing in INSN. */
static void
verify_insn_sharing (rtx insn)
{
gcc_assert (INSN_P (insn));
reset_used_flags (PATTERN (insn));
reset_used_flags (REG_NOTES (insn));
if (CALL_P (insn))
reset_used_flags (CALL_INSN_FUNCTION_USAGE (insn));
}
/* Go through all the RTL insn bodies and check that there is no unexpected /* Go through all the RTL insn bodies and check that there is no unexpected
sharing in between the subexpressions. */ sharing in between the subexpressions. */
...@@ -2643,10 +2657,12 @@ verify_rtl_sharing (void) ...@@ -2643,10 +2657,12 @@ verify_rtl_sharing (void)
for (p = get_insns (); p; p = NEXT_INSN (p)) for (p = get_insns (); p; p = NEXT_INSN (p))
if (INSN_P (p)) if (INSN_P (p))
{ {
verify_rtx_sharing (PATTERN (p), p); rtx pat = PATTERN (p);
verify_rtx_sharing (REG_NOTES (p), p); if (GET_CODE (pat) != SEQUENCE)
if (CALL_P (p)) verify_insn_sharing (p);
verify_rtx_sharing (CALL_INSN_FUNCTION_USAGE (p), p); else
for (int i = 0; i < XVECLEN (pat, 0); i++)
verify_insn_sharing (XVECEXP (pat, 0, i));
} }
reset_all_used_flags (); reset_all_used_flags ();
......
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