summaryrefslogtreecommitdiff
path: root/gcc/regclass.c
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-02 21:41:37 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-02 21:41:37 +0000
commit0fd4500a3c09e76744f3d67174e092530c863a5f (patch)
tree8a00f5b43c598532f161eef6222794b0969e1a8b /gcc/regclass.c
parent5f98b192ff4e08e7033ef3b5db370623ed4ba113 (diff)
downloadgcc-0fd4500a3c09e76744f3d67174e092530c863a5f.tar.gz
* print-rtl.c (print_rtx): Cast enums to int for comparison.
* c-decl.c (grokdeclarator): Cast enums to int for comparison and shifts. * c-format.c (C_STD_VER): Cast to int for comparisons. (check_function_format): Cast various enums to int for &. (maybe_read_dollar_number): Likewise. (check_format_info): Likewise. (check_format_info_main): Likewise. * expr.c (emit_move_insn_1): Cast enums to unsigned int for comparison. (safe_from_p): Likewise. * varasm.c (const_hash): Cast enum to int for %. * emit-rtl.c (init_emit_once): Use int loop variable to work around pcc enum problems with < and ++ operators. * regclass.c (init_reg_sets_1): Cast enums for comparison. (choose_hard_reg_mode): Use unsigned int to iterate over CCmodes. (regclass_init): Change enum class to int to iterate over reg_classes. * genrecog.c (merge_trees): Cast enums for comparison. * rtl.h (GET_CODE): Cast to enum rtx_code. (PUT_CODE): Cast to ENUM_BITFIELD(rtx_code). (GET_MODE): Cast to enum machine_mode. (PUT_MODE): Cast to ENUM_BITFIELD(machine_mode). (GET_NOTE_INSN_NAME): Cast enum to int. * tree.h (TREE_CODE): Cast to enum tree_code. (TREE_SET_CODE): Cast VALUE to ENUM_BITFIELD(tree_code). * timevar.c (timevar_print): Change loop variable id from enum to unsigned int. * fixinc/fixincl.c (VLEVEL): Cast enums in comparison to unsigned int. * config/i386/i386.md: Use PUT_MODE for mode assignment. * toplev.c (compile_file): Cast enum DFI to int. (decode_d_option): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40193 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/regclass.c')
-rw-r--r--gcc/regclass.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/gcc/regclass.c b/gcc/regclass.c
index 7986a1ee882..f65b2e9dd91 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -430,7 +430,7 @@ init_reg_sets_1 ()
}
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 (m = 0; m < (unsigned int) MAX_MACHINE_MODE; m++)
for (i = 0; i < N_REG_CLASSES; i++)
if (CLASS_MAX_NREGS (i, m) <= reg_class_size[i])
for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
@@ -445,7 +445,7 @@ init_reg_sets_1 ()
/* 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++)
+ for (m = 0; m < (unsigned int) MAX_MACHINE_MODE; m++)
if (allocatable_regs_of_mode [m])
{
for (i = 0; i < N_REG_CLASSES; i++)
@@ -631,6 +631,7 @@ choose_hard_reg_mode (regno, nregs)
unsigned int regno ATTRIBUTE_UNUSED;
unsigned int nregs;
{
+ unsigned int /* enum machine_mode */ m;
enum machine_mode found_mode = VOIDmode, mode;
/* We first look for the largest integer mode that can be validly
@@ -658,10 +659,13 @@ choose_hard_reg_mode (regno, nregs)
return found_mode;
/* Iterate over all of the CCmodes. */
- for (mode = CCmode; mode < NUM_MACHINE_MODES; ++mode)
- if (HARD_REGNO_NREGS (regno, mode) == nregs
- && HARD_REGNO_MODE_OK (regno, mode))
- return mode;
+ for (m = (unsigned int) CCmode; m < (unsigned int) NUM_MACHINE_MODES; ++m)
+ {
+ mode = (enum machine_mode) m;
+ if (HARD_REGNO_NREGS (regno, mode) == nregs
+ && HARD_REGNO_MODE_OK (regno, mode))
+ return mode;
+ }
/* We can't find a mode valid for this register. */
return VOIDmode;
@@ -859,22 +863,23 @@ dump_regclass (dump)
int i;
for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
{
- enum reg_class class;
+ int /* enum reg_class */ class;
if (REG_N_REFS (i))
{
fprintf (dump, " Register %i costs:", i);
- for (class = 0; class < N_REG_CLASSES; class++)
- if (contains_reg_of_mode [class][PSEUDO_REGNO_MODE (i)]
+ for (class = 0; class < (int) N_REG_CLASSES; class++)
+ if (contains_reg_of_mode [(enum reg_class) class][PSEUDO_REGNO_MODE (i)]
#ifdef FORBIDDEN_INC_DEC_CLASSES
- && (!in_inc_dec[i] || !forbidden_inc_dec_class[class])
+ && (!in_inc_dec[i]
+ || !forbidden_inc_dec_class[(enum reg_class) class])
#endif
#ifdef CLASS_CANNOT_CHANGE_MODE
&& (!REGNO_REG_SET_P (reg_changes_mode, i)
- || class_can_change_mode [class])
+ || class_can_change_mode [(enum reg_class) class])
#endif
)
- fprintf (dump, " %s:%i", reg_class_names[(int) class],
- costs[i].cost[class]);
+ fprintf (dump, " %s:%i", reg_class_names[class],
+ costs[i].cost[(enum reg_class) class]);
fprintf (dump, " MEM:%i\n", costs[i].mem_cost);
}
}