From 7cb10b40862da77eb3b5b1d8849fcf9586cc76ee Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 22 Oct 2009 15:13:10 +0000 Subject: * reload1.c (finish_spills): Also try to re-allocate pseudos currently on the stack. * ira-lives.c (process_single_reg_class_operands): Update the hard reg costs for all the hard registers desired by the single reg class operand. More small code generation improvements git-svn-id: https://gcc.gnu.org/svn/gcc/branches/reload-v2@153458 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog-ira-reload | 9 +++++++++ gcc/ira-lives.c | 11 +++++++---- gcc/reload1.c | 3 ++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog-ira-reload b/gcc/ChangeLog-ira-reload index bbb1af2e4b5..1354c4335ff 100644 --- a/gcc/ChangeLog-ira-reload +++ b/gcc/ChangeLog-ira-reload @@ -1,3 +1,12 @@ +2009-10-22 Jeff Law + + * reload1.c (finish_spills): Also try to re-allocate pseudos + currently on the stack. + + * ira-lives.c (process_single_reg_class_operands): Update the + hard reg costs for all the hard registers desired by the single + reg class operand. + 2009-10-15 Jeff Law * ira-reload.c (ira_bad_reload_regno): New function. diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c index 822dccb18d5..c67e89cbd79 100644 --- a/gcc/ira-lives.c +++ b/gcc/ira-lives.c @@ -841,6 +841,7 @@ process_single_reg_class_operands (bool in_p, int freq) [ira_class_hard_regs[cl][0]]) >= 0 && reg_class_size[cl] <= (unsigned) CLASS_MAX_NREGS (cl, mode)) { + int i, size; cost = (freq * (in_p @@ -848,10 +849,12 @@ process_single_reg_class_operands (bool in_p, int freq) : ira_get_register_move_cost (mode, cl, cover_class))); ira_allocate_and_set_costs (&ALLOCNO_CONFLICT_HARD_REG_COSTS (operand_a), cover_class, 0); - ALLOCNO_CONFLICT_HARD_REG_COSTS (operand_a) - [ira_class_hard_reg_index - [cover_class][ira_class_hard_regs[cl][0]]] - -= cost; + size = ira_reg_class_nregs[cover_class][mode]; + for (i = 0; i < size; i++) + ALLOCNO_CONFLICT_HARD_REG_COSTS (operand_a) + [ira_class_hard_reg_index + [cover_class][ira_class_hard_regs[cl][i]]] + -= cost; } } diff --git a/gcc/reload1.c b/gcc/reload1.c index 6c5c710c639..cc14673be92 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -4014,7 +4014,8 @@ finish_spills (int global) indicate which hard regs can't be used, and call ira_reassign_pseudos. */ for (n = 0, i = FIRST_PSEUDO_REGISTER; i < (unsigned) max_regno; i++) - if (reg_old_renumber[i] != reg_renumber[i]) + if ((reg_renumber[i] == -1 && REG_N_REFS(i) != 0) + || reg_old_renumber[i] != reg_renumber[i]) { if (reg_renumber[i] < 0) temp_pseudo_reg_arr[n++] = i; -- cgit v1.2.3