From 6df26b8f231266faea12111fff34af007b1b4177 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Mon, 19 Feb 2001 16:50:20 +0100 Subject: [PATCH] regclass.c (contains_reg_of_mode): Make global. * regclass.c (contains_reg_of_mode): Make global. (init_reg_sets): Remove contains_reg_of_mode; take into account CLASS_MAX_NREGS when looking for the proper mode. (dump_regclass): Dump only classes considered for the pseudo. (regclass): Use contains_reg_of_mode. From-SVN: r39891 --- gcc/ChangeLog | 8 ++++++++ gcc/regclass.c | 34 +++++++++++++++++++++++----------- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 70bd0243106..da7acf71516 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Mon Feb 19 16:47:39 CET 2001 Jan Hubicka + + * regclass.c (contains_reg_of_mode): Make global. + (init_reg_sets): Remove contains_reg_of_mode; take into account + CLASS_MAX_NREGS when looking for the proper mode. + (dump_regclass): Dump only classes considered for the pseudo. + (regclass): Use contains_reg_of_mode. + Mon Feb 19 16:45:42 CET 2001 Jan Hubicka * gcc.c (do_spec_1): 'n' for printing notices. diff --git a/gcc/regclass.c b/gcc/regclass.c index 3b07c13f870..7986a1ee882 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -174,6 +174,10 @@ const char * reg_names[] = REGISTER_NAMES; enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER]; +/* 1 if class does contain register of given mode. */ + +static char contains_reg_of_mode [N_REG_CLASSES] [MAX_MACHINE_MODE]; + /* Maximum cost of moving from a register in one class to a register in another class. Based on REGISTER_MOVE_COST. */ @@ -288,7 +292,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 @@ -429,14 +432,15 @@ init_reg_sets_1 () 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; - } + if (CLASS_MAX_NREGS (i, m) <= reg_class_size[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. */ @@ -860,6 +864,15 @@ dump_regclass (dump) { fprintf (dump, " Register %i costs:", i); for (class = 0; class < N_REG_CLASSES; class++) + if (contains_reg_of_mode [class][PSEUDO_REGNO_MODE (i)] +#ifdef FORBIDDEN_INC_DEC_CLASSES + && (!in_inc_dec[i] || !forbidden_inc_dec_class[class]) +#endif +#ifdef CLASS_CANNOT_CHANGE_MODE + && (!REGNO_REG_SET_P (reg_changes_mode, i) + || class_can_change_mode [class]) +#endif + ) fprintf (dump, " %s:%i", reg_class_names[(int) class], costs[i].cost[class]); fprintf (dump, " MEM:%i\n", costs[i].mem_cost); @@ -1224,8 +1237,7 @@ regclass (f, nregs, dump) { /* Ignore classes that are too small for this operand or invalid for a operand that was auto-incremented. */ - if (CLASS_MAX_NREGS (class, PSEUDO_REGNO_MODE (i)) - > reg_class_size[class] + if (!contains_reg_of_mode [class][PSEUDO_REGNO_MODE (i)] #ifdef FORBIDDEN_INC_DEC_CLASSES || (in_inc_dec[i] && forbidden_inc_dec_class[class]) #endif -- 2.30.2