aboutsummaryrefslogtreecommitdiff
path: root/gcc/regclass.c
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-02-02 22:25:11 +0000
committerRichard Stallman <rms@gnu.org>1993-02-02 22:25:11 +0000
commit089e575bb026643d369f674640a28ffee2a40fda (patch)
tree8dc0d346bc155890096f03730a122b681e61b8e5 /gcc/regclass.c
parentb670485b6a73554456655d6881ddd17ba017d51c (diff)
downloadgcc-089e575bb026643d369f674640a28ffee2a40fda.zip
gcc-089e575bb026643d369f674640a28ffee2a40fda.tar.gz
gcc-089e575bb026643d369f674640a28ffee2a40fda.tar.bz2
(int_reg_class_contents): Make unsigned to avoid signed integer overflow.
(init_reg_sets): Avoid signed integer overflow. From-SVN: r3411
Diffstat (limited to 'gcc/regclass.c')
-rw-r--r--gcc/regclass.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/regclass.c b/gcc/regclass.c
index 5501a8c..80d008a 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -115,14 +115,14 @@ int reg_alloc_order[FIRST_PSEUDO_REGISTER] = REG_ALLOC_ORDER;
HARD_REG_SET reg_class_contents[N_REG_CLASSES];
-/* The same information, but as an array of ints. We copy from these
- ints to the table above. This is done so that the tm.h files do
- not have to be aware of the wordsize for machines with <= 64 regs. */
+/* The same information, but as an array of unsigned ints. We copy from
+ these unsigned ints to the table above. We do this so the tm.h files
+ do not have to be aware of the wordsize for machines with <= 64 regs. */
#define N_REG_INTS \
((FIRST_PSEUDO_REGISTER + (HOST_BITS_PER_INT - 1)) / HOST_BITS_PER_INT)
-static int int_reg_class_contents[N_REG_CLASSES][N_REG_INTS]
+static unsigned int_reg_class_contents[N_REG_CLASSES][N_REG_INTS]
= REG_CLASS_CONTENTS;
/* For each reg class, number of regs it contains. */
@@ -201,7 +201,7 @@ init_reg_sets ()
for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
if (int_reg_class_contents[i][j / HOST_BITS_PER_INT]
- & (1 << (j % HOST_BITS_PER_INT)))
+ & ((unsigned) 1 << (j % HOST_BITS_PER_INT)))
SET_HARD_REG_BIT (reg_class_contents[i], j);
}