aboutsummaryrefslogtreecommitdiff
path: root/gcc/lra-constraints.c
diff options
context:
space:
mode:
authorVladimir Makarov <vmakarov@redhat.com>2016-04-06 16:48:36 +0000
committerVladimir Makarov <vmakarov@gcc.gnu.org>2016-04-06 16:48:36 +0000
commitbc2fc1f3b84472865724b7e91b540ca0fadedd1b (patch)
tree7cada23d7ebb7839e393ccbce8fed46721ed7422 /gcc/lra-constraints.c
parent469abfd2efbeb0923f4f07fbd67d1b8812f25479 (diff)
downloadgcc-bc2fc1f3b84472865724b7e91b540ca0fadedd1b.zip
gcc-bc2fc1f3b84472865724b7e91b540ca0fadedd1b.tar.gz
gcc-bc2fc1f3b84472865724b7e91b540ca0fadedd1b.tar.bz2
re PR rtl-optimization/70398 (gcc.dg/vect/slp-multitypes-9.c FAILs with -fno-tree-loop-optimize -fno-tree-ter)
2016-04-06 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/70398 * lra-constraints.c (process_address_1): Check zero scale and code for reloading with zero scale. 2016-04-06 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/70398 * testsuite/gcc.target/aarch64/pr70398.c: New. From-SVN: r234792
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r--gcc/lra-constraints.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index 4883eef..c00afe7 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -2914,6 +2914,7 @@ process_address_1 (int nop, bool check_only_p,
{
struct address_info ad;
rtx new_reg;
+ HOST_WIDE_INT scale;
rtx op = *curr_id->operand_loc[nop];
const char *constraint = curr_static_id->operand[nop].constraint;
enum constraint_num cn = lookup_constraint (constraint);
@@ -3161,14 +3162,14 @@ process_address_1 (int nop, bool check_only_p,
*ad.inner = simplify_gen_binary (PLUS, GET_MODE (new_reg),
new_reg, *ad.index);
}
- else if (get_index_scale (&ad) == 1)
+ else if ((scale = get_index_scale (&ad)) == 1)
{
/* The last transformation to one reg will be made in
curr_insn_transform function. */
end_sequence ();
return false;
}
- else
+ else if (scale != 0)
{
/* base + scale * index => base + new_reg,
case (1) above.
@@ -3180,6 +3181,17 @@ process_address_1 (int nop, bool check_only_p,
*ad.inner = simplify_gen_binary (PLUS, GET_MODE (new_reg),
*ad.base_term, new_reg);
}
+ else
+ {
+ enum reg_class cl = base_reg_class (ad.mode, ad.as,
+ SCRATCH, SCRATCH);
+ rtx addr = *ad.inner;
+
+ new_reg = lra_create_new_reg (Pmode, NULL_RTX, cl, "addr");
+ /* addr => new_base. */
+ lra_emit_move (new_reg, addr);
+ *ad.inner = new_reg;
+ }
*before = get_insns ();
end_sequence ();
return true;