From c7c0ae3d7fb8d06435a7edf500aa0fa7e4407555 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 14 Feb 2001 02:12:20 -0800 Subject: [PATCH] * regclass.c (init_reg_sets_1): Revert last two changes. From-SVN: r39669 --- gcc/ChangeLog | 4 +++ gcc/regclass.c | 97 +++++++++++++++++--------------------------------- 2 files changed, 36 insertions(+), 65 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bde3b9e5ff4..09c8a733cb5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2001-02-14 Richard Henderson + + * regclass.c (init_reg_sets_1): Revert last two changes. + 2001-02-14 Jakub Jelinek * stor-layout.c (is_pending_size, put_pending_size): New functions. diff --git a/gcc/regclass.c b/gcc/regclass.c index 8764cdb827b..610de28f1b4 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -288,8 +288,6 @@ init_reg_sets_1 () { register unsigned int i, j; register unsigned int /* enum machine_mode */ m; - char contains_reg_of_mode [N_REG_CLASSES] [MAX_MACHINE_MODE]; - char allocatable_regs_of_mode [MAX_MACHINE_MODE]; /* This macro allows the fixed or call-used registers and the register classes to depend on target flags. */ @@ -425,75 +423,44 @@ init_reg_sets_1 () if (CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (i))) SET_HARD_REG_BIT (losing_caller_save_reg_set, i); } - memset (contains_reg_of_mode, 0, sizeof (contains_reg_of_mode)); - memset (allocatable_regs_of_mode, 0, sizeof (allocatable_regs_of_mode)); - for (m = 0; m < MAX_MACHINE_MODE; m++) - for (i = 0; i < N_REG_CLASSES; i++) - for (j = 0; j < FIRST_PSEUDO_REGISTER; j++) - if (!fixed_regs [j] && TEST_HARD_REG_BIT (reg_class_contents[i], j) - && HARD_REGNO_MODE_OK (j, m)) - { - contains_reg_of_mode [i][m] = 1; - allocatable_regs_of_mode [m] = 1; - break; - } /* Initialize the move cost table. Find every subset of each class and take the maximum cost of moving any subset to any other. */ for (m = 0; m < MAX_MACHINE_MODE; m++) - if (allocatable_regs_of_mode [m]) - { - for (i = 0; i < N_REG_CLASSES; i++) - if (contains_reg_of_mode [i][m]) - for (j = 0; j < N_REG_CLASSES; j++) - { - int cost; - enum reg_class *p1, *p2; - - if (!contains_reg_of_mode [j][m]) - { - move_cost[m][i][j] = 65536; - may_move_in_cost[m][i][j] = 65536; - may_move_out_cost[m][i][j] = 65536; - } - else - { - cost = i == j ? 2 : REGISTER_MOVE_COST (m, i, j); - - for (p2 = ®_class_subclasses[j][0]; - *p2 != LIM_REG_CLASSES; - p2++) - if (*p2 != i && contains_reg_of_mode [*p1][m]) - cost = MAX (cost, move_cost [m][i][*p2]); - - for (p1 = ®_class_subclasses[i][0]; - *p1 != LIM_REG_CLASSES; - p1++) - if (*p1 != j && contains_reg_of_mode [*p1][m]) - cost = MAX (cost, move_cost [m][*p1][j]); - - move_cost[m][i][j] = cost; - - if (reg_class_subset_p (i, j)) - may_move_in_cost[m][i][j] = 0; - else - may_move_in_cost[m][i][j] = cost; - - if (reg_class_subset_p (j, i)) - may_move_out_cost[m][i][j] = 0; - else - may_move_out_cost[m][i][j] = cost; - } - } + for (i = 0; i < N_REG_CLASSES; i++) + for (j = 0; j < N_REG_CLASSES; j++) + { + int cost = i == j ? 2 : REGISTER_MOVE_COST (m, i, j); + enum reg_class *p1, *p2; + + for (p2 = ®_class_subclasses[j][0]; *p2 != LIM_REG_CLASSES; p2++) + if (*p2 != i) + cost = MAX (cost, REGISTER_MOVE_COST (m, i, *p2)); + + for (p1 = ®_class_subclasses[i][0]; *p1 != LIM_REG_CLASSES; p1++) + { + if (*p1 != j) + cost = MAX (cost, REGISTER_MOVE_COST (m, *p1, j)); + + for (p2 = ®_class_subclasses[j][0]; + *p2 != LIM_REG_CLASSES; p2++) + if (*p1 != *p2) + cost = MAX (cost, REGISTER_MOVE_COST (m, *p1, *p2)); + } + + move_cost[m][i][j] = cost; + + if (reg_class_subset_p (i, j)) + may_move_in_cost[m][i][j] = 0; else - for (j = 0; j < N_REG_CLASSES; j++) - { - move_cost[m][i][j] = 65536; - may_move_in_cost[m][i][j] = 65536; - may_move_out_cost[m][i][j] = 65536; - } - } + may_move_in_cost[m][i][j] = cost; + + if (reg_class_subset_p (j, i)) + may_move_out_cost[m][i][j] = 0; + else + may_move_out_cost[m][i][j] = cost; + } #ifdef CLASS_CANNOT_CHANGE_MODE { -- 2.30.2