diff options
author | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-07-16 15:26:35 +0000 |
---|---|---|
committer | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-07-16 15:26:35 +0000 |
commit | bf9df576a556d0557068d5f90430e4e2bb4267e5 (patch) | |
tree | 8007d3add2ae6117cc209d5f0d76980482f23ff8 /gcc/ira-costs.c | |
parent | 1739ec91f99e0b9f914fa10280d7529d918b2c6f (diff) |
2015-07-16 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/66626
* ira.h (emit-rtl.h): Include.
(non_spilled_static_chain_regno_p): New.
* ira-color.c (setup_profitable_hard_regs): Clear profitable regs
unless it is non spilled static chain pseudo.
(assign_hard_rego): Spill memory profitable allocno unless it is
non spilled static chain pseudo.
(allocno_spill_priority_compare): Put non spilled static chain
pseudo at the end of sorted array.
(improve_allocation): Do nothing if we have static chain and
non-local goto.
(allocno__priority_compare_func): Put non spilled static chain
pseudo at the beginning of sorted array.
(move_spill_restore): Ignore non spilled static chain pseudo.
* ira-costs.c (find_costs_and_classes): Don't assign class NO_REGS
to non spilled static chain pseudo.
* lra-assigns.c (pseudo_compare_func): Put non spilled static chain
pseudo at the beginning of sorted array.
(spill_for): Spill non spilled static chain pseudo last.
* lra-constraints.c (lra_constraints): Remove static chain pseudo
check for equivalence.
2015-07-16 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/66626
* gcc.target/i386/pr66626-2.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225891 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ira-costs.c')
-rw-r--r-- | gcc/ira-costs.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c index 0a5b1e12964..eded4d9f525 100644 --- a/gcc/ira-costs.c +++ b/gcc/ira-costs.c @@ -1836,7 +1836,8 @@ find_costs_and_classes (FILE *dump_file) alt_class = reg_class_subunion[alt_class][rclass]; } alt_class = ira_allocno_class_translate[alt_class]; - if (best_cost > i_mem_cost) + if (best_cost > i_mem_cost + && ! non_spilled_static_chain_regno_p (i)) regno_aclass[i] = NO_REGS; else if (!optimize && !targetm.class_likely_spilled_p (best)) /* Registers in the alternative class are likely to need @@ -1875,7 +1876,10 @@ find_costs_and_classes (FILE *dump_file) } if (pass == flag_expensive_optimizations) { - if (best_cost > i_mem_cost) + if (best_cost > i_mem_cost + /* Do not assign NO_REGS to static chain pointer + pseudo when non-local goto is used. */ + && ! non_spilled_static_chain_regno_p (i)) best = alt_class = NO_REGS; else if (best == alt_class) alt_class = NO_REGS; @@ -1890,7 +1894,9 @@ find_costs_and_classes (FILE *dump_file) regno_best_class[i] = best; if (! allocno_p) { - pref[i] = best_cost > i_mem_cost ? NO_REGS : best; + pref[i] = (best_cost > i_mem_cost + && ! non_spilled_static_chain_regno_p (i) + ? NO_REGS : best); continue; } for (a = ira_regno_allocno_map[i]; |