Commit d0cac36f by Richard Sandiford Committed by Richard Sandiford

mips.c (r10k_needs_protection_p_call): Take a const_rtx and return a bool.

gcc/
	* config/mips/mips.c (r10k_needs_protection_p_call): Take a const_rtx
	and return a bool.  Iterate over all subrtxes here.
	(r10k_needs_protection_p): Update accordingly.

From-SVN: r216712
parent 9989ddc8
2014-10-26 Richard Sandiford <richard.sandiford@arm.com> 2014-10-26 Richard Sandiford <richard.sandiford@arm.com>
* config/mips/mips.c (r10k_needs_protection_p_call): Take a const_rtx
and return a bool. Iterate over all subrtxes here.
(r10k_needs_protection_p): Update accordingly.
2014-10-26 Richard Sandiford <richard.sandiford@arm.com>
* config/mips/mips.c (r10k_needs_protection_p_1): Take an rtx * config/mips/mips.c (r10k_needs_protection_p_1): Take an rtx
rather than an rtx pointer. Change type of insn from "void *" rather than an rtx pointer. Change type of insn from "void *"
to its real type. Return bool rather than int. Iterate over to its real type. Return bool rather than int. Iterate over
...@@ -15102,23 +15102,26 @@ r10k_needs_protection_p_store (rtx x, const_rtx pat ATTRIBUTE_UNUSED, ...@@ -15102,23 +15102,26 @@ r10k_needs_protection_p_store (rtx x, const_rtx pat ATTRIBUTE_UNUSED,
*insn_ptr = NULL; *insn_ptr = NULL;
} }
/* A for_each_rtx callback that iterates over the pattern of a CALL_INSN. /* X is the pattern of a call instruction. Return true if the call is
Return nonzero if the call is not to a declared function. */ not to a declared function. */
static int static bool
r10k_needs_protection_p_call (rtx *loc, void *data ATTRIBUTE_UNUSED) r10k_needs_protection_p_call (const_rtx x)
{ {
rtx x; subrtx_iterator::array_type array;
FOR_EACH_SUBRTX (iter, array, x, NONCONST)
x = *loc; {
if (!MEM_P (x)) const_rtx mem = *iter;
return 0; if (MEM_P (mem))
{
x = XEXP (x, 0); const_rtx addr = XEXP (mem, 0);
if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_DECL (x)) if (GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_DECL (addr))
return -1; iter.skip_subrtxes ();
else
return 1; return true;
}
}
return false;
} }
/* Return true if instruction INSN needs to be protected by an R10K /* Return true if instruction INSN needs to be protected by an R10K
...@@ -15128,7 +15131,7 @@ static bool ...@@ -15128,7 +15131,7 @@ static bool
r10k_needs_protection_p (rtx_insn *insn) r10k_needs_protection_p (rtx_insn *insn)
{ {
if (CALL_P (insn)) if (CALL_P (insn))
return for_each_rtx (&PATTERN (insn), r10k_needs_protection_p_call, NULL); return r10k_needs_protection_p_call (PATTERN (insn));
if (mips_r10k_cache_barrier == R10K_CACHE_BARRIER_STORE) if (mips_r10k_cache_barrier == R10K_CACHE_BARRIER_STORE)
{ {
......
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