Commit 62332eba by Richard Sandiford Committed by Richard Sandiford

mips.c (r10k_safe_mem_expr_p): Use get_inner_reference.

gcc/
	* config/mips/mips.c (r10k_safe_mem_expr_p): Use get_inner_reference.

From-SVN: r190700
parent 1209ab5e
2012-08-26 Richard Sandiford <rdsandiford@googlemail.com> 2012-08-26 Richard Sandiford <rdsandiford@googlemail.com>
* config/mips/mips.c (r10k_safe_mem_expr_p): Use get_inner_reference.
2012-08-26 Richard Sandiford <rdsandiford@googlemail.com>
* config/mips/mips.c (mips_rtx_costs): Add costs for CINS. * config/mips/mips.c (mips_rtx_costs): Add costs for CINS.
2012-08-26 Richard Sandiford <rdsandiford@googlemail.com> 2012-08-26 Richard Sandiford <rdsandiford@googlemail.com>
......
...@@ -14398,17 +14398,18 @@ r10k_safe_address_p (rtx x, rtx insn) ...@@ -14398,17 +14398,18 @@ r10k_safe_address_p (rtx x, rtx insn)
static bool static bool
r10k_safe_mem_expr_p (tree expr, HOST_WIDE_INT offset) r10k_safe_mem_expr_p (tree expr, HOST_WIDE_INT offset)
{ {
if (offset < 0 || offset >= int_size_in_bytes (TREE_TYPE (expr))) HOST_WIDE_INT bitoffset, bitsize;
return false; tree inner, var_offset;
enum machine_mode mode;
int unsigned_p, volatile_p;
while (TREE_CODE (expr) == COMPONENT_REF) inner = get_inner_reference (expr, &bitsize, &bitoffset, &var_offset, &mode,
{ &unsigned_p, &volatile_p, false);
expr = TREE_OPERAND (expr, 0); if (!DECL_P (inner) || !DECL_SIZE_UNIT (inner) || var_offset)
if (expr == NULL_TREE) return false;
return false;
}
return DECL_P (expr); offset += bitoffset / BITS_PER_UNIT;
return offset >= 0 && offset < tree_low_cst (DECL_SIZE_UNIT (inner), 1);
} }
/* A for_each_rtx callback for which DATA points to the instruction /* A for_each_rtx callback for which DATA points to the instruction
......
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