From 35bdbc6962988219faf2c7bf2a0dabd3d8657adb Mon Sep 17 00:00:00 2001 From: Anatoly Sokolov Date: Wed, 3 Aug 2011 22:03:04 +0400 Subject: [PATCH] m32c.c (class_sizes): Remove. * config/m32c/m32c.c (class_sizes): Remove. (reduce_class): Change arguments and return type to reg_class_t. Change type cc var to HARD_REG_SET. Change type best var to reg_class_t. Change type best_size var to unsigned int. Remove initialization class_sizes var. Use reg_class_size array instead of class_sizes. Use reg_class_contents array instead of class_contents. From-SVN: r177290 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/m32c/m32c.c | 39 +++++++++++++-------------------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 886b360da4f..63aef194f90 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2011-08-03 Anatoly Sokolov + + * config/m32c/m32c.c (class_sizes): Remove. + (reduce_class): Change arguments and return type to reg_class_t. + Change type cc var to HARD_REG_SET. Change type best var to + reg_class_t. Change type best_size var to unsigned int. Remove + initialization class_sizes var. Use reg_class_size array instead + of class_sizes. Use reg_class_contents array instead + of class_contents. + 2011-08-03 Richard Guenther PR middle-end/49958 diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 4ae7228f772..4aeeb3d9ebb 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -318,44 +318,31 @@ reg_push_size (int regno) } } -static int *class_sizes = 0; - /* Given two register classes, find the largest intersection between them. If there is no intersection, return RETURNED_IF_EMPTY instead. */ -static int -reduce_class (int original_class, int limiting_class, int returned_if_empty) +static reg_class_t +reduce_class (reg_class_t original_class, reg_class_t limiting_class, + reg_class_t returned_if_empty) { - int cc = class_contents[original_class][0]; - int i, best = NO_REGS; - int best_size = 0; + HARD_REG_SET cc; + int i; + reg_class_t best = NO_REGS; + unsigned int best_size = 0; if (original_class == limiting_class) return original_class; - if (!class_sizes) - { - int r; - class_sizes = (int *) xmalloc (LIM_REG_CLASSES * sizeof (int)); - for (i = 0; i < LIM_REG_CLASSES; i++) - { - class_sizes[i] = 0; - for (r = 0; r < FIRST_PSEUDO_REGISTER; r++) - if (class_contents[i][0] & (1 << r)) - class_sizes[i]++; - } - } + cc = reg_class_contents[original_class]; + AND_HARD_REG_SET (cc, reg_class_contents[limiting_class]); - cc &= class_contents[limiting_class][0]; for (i = 0; i < LIM_REG_CLASSES; i++) { - int ic = class_contents[i][0]; - - if ((~cc & ic) == 0) - if (best_size < class_sizes[i]) + if (hard_reg_set_subset_p (reg_class_contents[i], cc)) + if (best_size < reg_class_size[i]) { - best = i; - best_size = class_sizes[i]; + best = (reg_class_t) i; + best_size = reg_class_size[i]; } } -- 2.30.2