Commit 70712859 by Kaz Kojima

lra-constraints.c (process_address_1): Swap base_term and index_term if…

lra-constraints.c (process_address_1): Swap base_term and index_term if INDEX_REG_CLASS is assigned to base_term...

* lra-constraints.c (process_address_1): Swap base_term and index_term
  if INDEX_REG_CLASS is assigned to base_term already when INDEX_REG_CLASS
  is a single register class.

From-SVN: r218885
parent 47b6f982
2014-12-19 Kaz Kojima <kkojima@gcc.gnu.org>
* lra-constraints.c (process_address_1): Swap base_term and
index_term if INDEX_REG_CLASS is assigned to base_term already
when INDEX_REG_CLASS is a single register class.
2014-12-18 Vladimir Makarov <vmakarov@redhat.com>
* lra-constraints.c (lra-constraints.c): Exchange places of sclass
......@@ -2834,6 +2834,20 @@ process_address_1 (int nop, bool check_only_p,
decompose_mem_address (&ad, SUBREG_REG (op));
else
return false;
/* If INDEX_REG_CLASS is assigned to base_term already and isn't to
index_term, swap them so to avoid assigning INDEX_REG_CLASS to both
when INDEX_REG_CLASS is a single register class. */
if (ad.base_term != NULL
&& ad.index_term != NULL
&& ira_class_hard_regs_num[INDEX_REG_CLASS] == 1
&& REG_P (*ad.base_term)
&& REG_P (*ad.index_term)
&& in_class_p (*ad.base_term, INDEX_REG_CLASS, NULL)
&& ! in_class_p (*ad.index_term, INDEX_REG_CLASS, NULL))
{
std::swap (ad.base, ad.index);
std::swap (ad.base_term, ad.index_term);
}
if (! check_only_p)
change_p = equiv_address_substitution (&ad);
if (ad.base_term != NULL
......
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