diff options
author | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-20 21:29:36 +0000 |
---|---|---|
committer | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-12-20 21:29:36 +0000 |
commit | 99d809ea8929e107873917aac29c16a16bf50938 (patch) | |
tree | 84a9907be731914d6a5e2d06a3ddeca3eab7ae65 /gcc/ira-costs.c | |
parent | d77ac56d6025a8fa68cd9fefad0729bb5d74d675 (diff) | |
download | gcc-99d809ea8929e107873917aac29c16a16bf50938.tar.gz |
2011-12-20 Vladimir Makarov <vmakarov@redhat.com>
PR target/49865
* ira-costs.c (find_costs_and_classes): Prefer registers even
if the memory cost is the same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182553 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ira-costs.c')
-rw-r--r-- | gcc/ira-costs.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c index 4fa12a2ae19..4f2f8412f7c 100644 --- a/gcc/ira-costs.c +++ b/gcc/ira-costs.c @@ -1693,7 +1693,14 @@ find_costs_and_classes (FILE *dump_file) else if (i_costs[k] == best_cost) best = ira_reg_class_subunion[best][rclass]; if (pass == flag_expensive_optimizations - && i_costs[k] < i_mem_cost + /* We still prefer registers to memory even at this + stage if their costs are the same. We will make + a final decision during assigning hard registers + when we have all info including more accurate + costs which might be affected by assigning hard + registers to other pseudos because the pseudos + involved in moves can be coalesced. */ + && i_costs[k] <= i_mem_cost && (reg_class_size[reg_class_subunion[alt_class][rclass]] > reg_class_size[alt_class])) alt_class = reg_class_subunion[alt_class][rclass]; |