aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/mips
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2012-08-26 19:20:31 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2012-08-26 19:20:31 +0000
commit62332eba32708fbe911dcea662b17410bab8faa5 (patch)
tree2fcff95bf9d3750037a1db0cc7521d47392b2e89 /gcc/config/mips
parent1209ab5ed6540a37f5b0afe0c494c5771ba515ab (diff)
downloadgcc-62332eba32708fbe911dcea662b17410bab8faa5.zip
gcc-62332eba32708fbe911dcea662b17410bab8faa5.tar.gz
gcc-62332eba32708fbe911dcea662b17410bab8faa5.tar.bz2
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
Diffstat (limited to 'gcc/config/mips')
-rw-r--r--gcc/config/mips/mips.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 1f0c9ae..3a19f44 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -14398,17 +14398,18 @@ r10k_safe_address_p (rtx x, rtx insn)
static bool
r10k_safe_mem_expr_p (tree expr, HOST_WIDE_INT offset)
{
- if (offset < 0 || offset >= int_size_in_bytes (TREE_TYPE (expr)))
- return false;
+ HOST_WIDE_INT bitoffset, bitsize;
+ tree inner, var_offset;
+ enum machine_mode mode;
+ int unsigned_p, volatile_p;
- while (TREE_CODE (expr) == COMPONENT_REF)
- {
- expr = TREE_OPERAND (expr, 0);
- if (expr == NULL_TREE)
- return false;
- }
+ inner = get_inner_reference (expr, &bitsize, &bitoffset, &var_offset, &mode,
+ &unsigned_p, &volatile_p, false);
+ if (!DECL_P (inner) || !DECL_SIZE_UNIT (inner) || var_offset)
+ 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