aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoly Sokolov <aesok@post.ru>2011-08-03 22:03:04 +0400
committerAnatoly Sokolov <aesok@gcc.gnu.org>2011-08-03 22:03:04 +0400
commit35bdbc6962988219faf2c7bf2a0dabd3d8657adb (patch)
treec5e5b886196ec6b0e63a26f8d56c271be88dc87b
parent41ba34dbe7e8494254b524e8e31e394a1e6c6585 (diff)
downloadgcc-35bdbc6962988219faf2c7bf2a0dabd3d8657adb.zip
gcc-35bdbc6962988219faf2c7bf2a0dabd3d8657adb.tar.gz
gcc-35bdbc6962988219faf2c7bf2a0dabd3d8657adb.tar.bz2
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
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/m32c/m32c.c39
2 files changed, 23 insertions, 26 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 886b360..63aef19 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2011-08-03 Anatoly Sokolov <aesok@post.ru>
+
+ * 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 <rguenther@suse.de>
PR middle-end/49958
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 4ae7228..4aeeb3d 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];
}
}