Commit 4ef20c29 by Zhenqiang Chen Committed by Zhenqiang Chen

re PR rtl-optimization/63210 (ira does not select the best register compared…

re PR rtl-optimization/63210 (ira does not select the best register compared with gcc 4.8 for ARM THUMB1)

ChangeLog:
2014-09-24  Zhenqiang Chen  <zhenqiang.chen@arm.com>

	PR rtl-optimization/63210
	* ira-color.c (assign_hard_reg): Ignore conflict cost if the
	HARD_REGNO is not availabe for CONFLICT_A.

testsuite/ChangeLog:
2014-09-24  Zhenqiang Chen  <zhenqiang.chen@arm.com>

	* gcc.target/arm/pr63210.c: New test.

From-SVN: r215540
parent f704cf4c
2014-09-24 Zhenqiang Chen <zhenqiang.chen@arm.com>
PR rtl-optimization/63210
* ira-color.c (assign_hard_reg): Ignore conflict cost if the
HARD_REGNO is not available for CONFLICT_A.
2014-09-23 Andi Kleen <ak@linux.intel.com> 2014-09-23 Andi Kleen <ak@linux.intel.com>
* cgraph.h (symtab_node): Add no_reorder attribute. * cgraph.h (symtab_node): Add no_reorder attribute.
...@@ -1709,6 +1709,7 @@ assign_hard_reg (ira_allocno_t a, bool retry_p) ...@@ -1709,6 +1709,7 @@ assign_hard_reg (ira_allocno_t a, bool retry_p)
{ {
ira_allocno_t conflict_a = OBJECT_ALLOCNO (conflict_obj); ira_allocno_t conflict_a = OBJECT_ALLOCNO (conflict_obj);
enum reg_class conflict_aclass; enum reg_class conflict_aclass;
allocno_color_data_t data = ALLOCNO_COLOR_DATA (conflict_a);
/* Reload can give another class so we need to check all /* Reload can give another class so we need to check all
allocnos. */ allocnos. */
...@@ -1780,7 +1781,12 @@ assign_hard_reg (ira_allocno_t a, bool retry_p) ...@@ -1780,7 +1781,12 @@ assign_hard_reg (ira_allocno_t a, bool retry_p)
hard_regno = ira_class_hard_regs[aclass][j]; hard_regno = ira_class_hard_regs[aclass][j];
ira_assert (hard_regno >= 0); ira_assert (hard_regno >= 0);
k = ira_class_hard_reg_index[conflict_aclass][hard_regno]; k = ira_class_hard_reg_index[conflict_aclass][hard_regno];
if (k < 0) if (k < 0
/* If HARD_REGNO is not available for CONFLICT_A,
the conflict would be ignored, since HARD_REGNO
will never be assigned to CONFLICT_A. */
|| !TEST_HARD_REG_BIT (data->profitable_hard_regs,
hard_regno))
continue; continue;
full_costs[j] -= conflict_costs[k]; full_costs[j] -= conflict_costs[k];
} }
......
2014-09-24 Zhenqiang Chen <zhenqiang.chen@arm.com>
* gcc.target/arm/pr63210.c: New test.
2014-09-23 Andi Kleen <ak@linux.intel.com> 2014-09-23 Andi Kleen <ak@linux.intel.com>
* gcc.dg/noreorder.c: New test. * gcc.dg/noreorder.c: New test.
......
/* { dg-do assemble } */
/* { dg-options "-mthumb -Os " } */
/* { dg-require-effective-target arm_thumb1_ok } */
int foo1 (int c);
int foo2 (int c);
int test (int c)
{
return (foo1 (c) || foo2 (c));
}
/* { dg-final { object-size text <= 28 } } */
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