* 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.
From-SVN: r40193
+2001-03-02 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * 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.
+
Fri Mar 2 12:18:13 2001 Christopher Faylor <cgf@cygnus.com>
* cppinit.c (append_include_chain): Mark "after" include file name list
if (TREE_CODE (id) == IDENTIFIER_NODE && C_IS_RESERVED_WORD (id))
{
enum rid i = C_RID_CODE (id);
- if (i <= RID_LAST_MODIFIER)
+ if ((int) i <= (int) RID_LAST_MODIFIER)
{
- if (i == RID_LONG && specbits & (1<<i))
+ if (i == RID_LONG && (specbits & (1 << (int) i)))
{
if (longlong)
error ("`long long long' is too long for GCC");
longlong = 1;
}
}
- else if (specbits & (1 << i))
+ else if (specbits & (1 << (int) i))
pedwarn ("duplicate `%s'", IDENTIFIER_POINTER (id));
- specbits |= 1 << i;
+ specbits |= 1 << (int) i;
goto found;
}
}
or inheriting from, for the purpose of format features supported. */
#define CPLUSPLUS_STD_VER STD_C89
/* The C standard version we are checking formats against when pedantic. */
-#define C_STD_VER (c_language == clk_cplusplus \
+#define C_STD_VER ((int)(c_language == clk_cplusplus \
? CPLUSPLUS_STD_VER \
: (flag_isoc99 \
? STD_C99 \
- : (flag_isoc94 ? STD_C94 : STD_C89)))
+ : (flag_isoc94 ? STD_C94 : STD_C89))))
/* The name to give to the standard version we are warning about when
pedantic. FEATURE_VER is the version in which the feature warned out
appeared, which is higher than C_STD_VER. */
/* Yup; check it. */
check_format_info (status, info, params);
if (warn_missing_format_attribute && info->first_arg_num == 0
- && (format_types[info->format_type].flags & FMT_FLAG_ARG_CONVERT))
+ && (format_types[info->format_type].flags
+ & (int) FMT_FLAG_ARG_CONVERT))
{
function_format_info *info2;
for (info2 = function_format_list; info2; info2 = info2->next)
nalloc - dollar_arguments_alloc);
dollar_arguments_alloc = nalloc;
}
- if (!(fki->flags & FMT_FLAG_DOLLAR_MULTIPLE)
+ if (!(fki->flags & (int) FMT_FLAG_DOLLAR_MULTIPLE)
&& dollar_arguments_used[argnum - 1] == 1)
{
dollar_arguments_used[argnum - 1] = 2;
/* Functions taking a va_list normally pass a non-literal format
string. These functions typically are declared with
first_arg_num == 0, so avoid warning in those cases. */
- if (!(format_types[info->format_type].flags & FMT_FLAG_ARG_CONVERT))
+ if (!(format_types[info->format_type].flags & (int) FMT_FLAG_ARG_CONVERT))
{
/* For strftime-like formats, warn for not checking the format
string; but there are no arguments to check. */
}
flag_chars[0] = 0;
- if ((fki->flags & FMT_FLAG_USE_DOLLAR) && has_operand_number != 0)
+ if ((fki->flags & (int) FMT_FLAG_USE_DOLLAR) && has_operand_number != 0)
{
/* Possibly read a $ operand number at the start of the format.
If one was previously used, one is required here. If one
++format_chars;
}
if (found_width && !non_zero_width_char &&
- (fki->flags & FMT_FLAG_ZERO_WIDTH_BAD))
+ (fki->flags & (int) FMT_FLAG_ZERO_WIDTH_BAD))
status_warning (status, "zero width in %s format",
fki->name);
if (found_width)
}
else
{
- if (!(fki->flags & FMT_FLAG_EMPTY_PREC_OK)
+ if (!(fki->flags & (int) FMT_FLAG_EMPTY_PREC_OK)
&& !ISDIGIT (*format_chars))
status_warning (status, "empty precision in %s format",
fki->name);
}
/* Handle the scanf allocation kludge. */
- if (fki->flags & FMT_FLAG_SCANF_A_KLUDGE)
+ if (fki->flags & (int) FMT_FLAG_SCANF_A_KLUDGE)
{
if (*format_chars == 'a' && !flag_isoc99)
{
format_char = *format_chars;
if (format_char == 0
- || (!(fki->flags & FMT_FLAG_FANCY_PERCENT_OK) && format_char == '%'))
+ || (!(fki->flags & (int) FMT_FLAG_FANCY_PERCENT_OK)
+ && format_char == '%'))
{
status_warning (status, "conversion lacks type at end of format");
continue;
flag_chars[i - d] = 0;
}
- if ((fki->flags & FMT_FLAG_SCANF_A_KLUDGE)
+ if ((fki->flags & (int) FMT_FLAG_SCANF_A_KLUDGE)
&& strchr (flag_chars, 'a') != 0)
aflag = 1;
wanted_type = 0;
wanted_type_name = 0;
- if (fki->flags & FMT_FLAG_ARG_CONVERT)
+ if (fki->flags & (int) FMT_FLAG_ARG_CONVERT)
{
wanted_type = (fci->types[length_chars_val].type
? *fci->types[length_chars_val].type : 0);
operands[1] = gen_lowpart (SImode, operands[1]);
if (GET_CODE (operands[3]) != ASHIFT)
operands[2] = gen_lowpart (SImode, operands[2]);
- GET_MODE (operands[3]) = SImode;")
+ PUT_MODE (operands[3], SImode);")
(define_split
[(set (reg 17)
const_tiny_rtx[i][(int) mode] = GEN_INT (i);
}
- for (mode = CCmode; mode < MAX_MACHINE_MODE; ++mode)
- if (GET_MODE_CLASS (mode) == MODE_CC)
- const_tiny_rtx[0][(int) mode] = const0_rtx;
+ for (i = (int) CCmode; i < (int) MAX_MACHINE_MODE; ++i)
+ if (GET_MODE_CLASS ((enum machine_mode) i) == MODE_CC)
+ const_tiny_rtx[0][i] = const0_rtx;
const_tiny_rtx[0][(int) BImode] = const0_rtx;
if (STORE_FLAG_VALUE == 1)
enum mode_class class = GET_MODE_CLASS (mode);
unsigned int i;
- if (mode >= MAX_MACHINE_MODE)
+ if ((unsigned int) mode >= (unsigned int) MAX_MACHINE_MODE)
abort ();
if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
/* If this is a language-specific tree code, it may require
special handling. */
- if (TREE_CODE (exp) >= LAST_AND_UNUSED_TREE_CODE
+ if ((unsigned int) TREE_CODE (exp)
+ >= (unsigned int) LAST_AND_UNUSED_TREE_CODE
&& lang_safe_from_p
&& !(*lang_safe_from_p) (x, exp))
return 0;
te_verbose verbose_level = VERB_PROGRESS;
int have_tty = 0;
-#define VLEVEL(l) (verbose_level >= l)
+#define VLEVEL(l) ((unsigned int) verbose_level >= (unsigned int) l)
#define NOT_SILENT VLEVEL(VERB_FIXES)
pid_t process_chain_head = (pid_t) -1;
how expensive/important the test is. Given that the tests
are also ordered within the list, examining the first is
sufficient. */
- if (add->tests->type < old->tests->type)
+ if ((int) add->tests->type < (int) old->tests->type)
insert_before = old;
}
/* Print NOTE_INSN names rather than integer codes. */
case 'n':
- if (XINT (in_rtx, i) >= NOTE_INSN_BIAS
- && XINT (in_rtx, i) < NOTE_INSN_MAX)
+ if (XINT (in_rtx, i) >= (int) NOTE_INSN_BIAS
+ && XINT (in_rtx, i) < (int) NOTE_INSN_MAX)
fprintf (outfile, " %s", GET_NOTE_INSN_NAME (XINT (in_rtx, i)));
else
fprintf (outfile, " %d", XINT (in_rtx, i));
}
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++)
/* 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++)
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
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;
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);
}
}
/* Define macros to access the `code' field of the rtx. */
-#define GET_CODE(RTX) ((RTX)->code)
-#define PUT_CODE(RTX, CODE) ((RTX)->code = (CODE))
+#define GET_CODE(RTX) ((enum rtx_code) (RTX)->code)
+#define PUT_CODE(RTX, CODE) ((RTX)->code = (ENUM_BITFIELD(rtx_code)) (CODE))
-#define GET_MODE(RTX) ((RTX)->mode)
-#define PUT_MODE(RTX, MODE) ((RTX)->mode = (MODE))
+#define GET_MODE(RTX) ((enum machine_mode) (RTX)->mode)
+#define PUT_MODE(RTX, MODE) ((RTX)->mode = (ENUM_BITFIELD(machine_mode)) (MODE))
#define RTX_INTEGRATED_P(RTX) ((RTX)->integrated)
#define RTX_UNCHANGING_P(RTX) ((RTX)->unchanging)
extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS];
#define GET_NOTE_INSN_NAME(NOTE_CODE) \
- (note_insn_name[(NOTE_CODE) - NOTE_INSN_BIAS])
+ (note_insn_name[(NOTE_CODE) - (int) NOTE_INSN_BIAS])
/* The name of a label, in case it corresponds to an explicit label
in the input source code. */
{
/* Only print stuff if we have some sort of time information. */
#if defined (HAVE_USER_TIME) || defined (HAVE_SYS_TIME) || defined (HAVE_WALL_TIME)
- timevar_id_t id;
+ unsigned int /* timevar_id_t */ id;
struct timevar_time_def *total = &timevars[TV_TOTAL].elapsed;
struct timevar_time_def now;
start_time = now;
fprintf (fp, _("\nExecution times (seconds)\n"));
- for (id = 0; id < TIMEVAR_LAST; ++id)
+ for (id = 0; id < (unsigned int) TIMEVAR_LAST; ++id)
{
- struct timevar_def *tv = &timevars[id];
+ struct timevar_def *tv = &timevars[(timevar_id_t) id];
/* Don't print the total execution time here; that goes at the
end. */
- if (id == TV_TOTAL)
+ if ((timevar_id_t) id == TV_TOTAL)
continue;
/* Don't print timing variables that were never used. */
{
int i;
- for (i = 0; i < DFI_MAX; ++i)
+ for (i = 0; i < (int) DFI_MAX; ++i)
if (dump_file[i].initialized && dump_file[i].graph_dump_p)
{
char seq[16];
switch (c = *arg++)
{
case 'a':
- for (i = 0; i < DFI_MAX; ++i)
+ for (i = 0; i < (int) DFI_MAX; ++i)
dump_file[i].enabled = 1;
break;
case 'A':
default:
matched = 0;
- for (i = 0; i < DFI_MAX; ++i)
+ for (i = 0; i < (int) DFI_MAX; ++i)
if (c == dump_file[i].debug_switch)
{
dump_file[i].enabled = 1;
/* The tree-code says what kind of node it is.
Codes are defined in tree.def. */
#define TREE_CODE(NODE) ((enum tree_code) (NODE)->common.code)
-#define TREE_SET_CODE(NODE, VALUE) ((NODE)->common.code = (int) (VALUE))
+#define TREE_SET_CODE(NODE, VALUE) \
+((NODE)->common.code = (ENUM_BITFIELD(tree_code)) (VALUE))
/* When checking is enabled, errors will be generated if a tree node
is accessed incorrectly. The macros abort with a fatal error. */
default:
/* A language specific constant. Just hash the code. */
- return code % MAX_HASH_TABLE;
+ return (int) code % MAX_HASH_TABLE;
}
/* Compute hashing function */