aboutsummaryrefslogtreecommitdiff
path: root/gcc/ira.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2009-04-24 15:31:38 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2009-04-24 15:31:38 +0000
commit32e8bb8ebfa8711799ed8f90326e9857e894ad8b (patch)
treecb72f4fe59cfd12ca2739fb042e2be3d62f721b6 /gcc/ira.c
parentac4fc08a0a80b216618a84b9452b38d5a22e82de (diff)
downloadgcc-32e8bb8ebfa8711799ed8f90326e9857e894ad8b.zip
gcc-32e8bb8ebfa8711799ed8f90326e9857e894ad8b.tar.gz
gcc-32e8bb8ebfa8711799ed8f90326e9857e894ad8b.tar.bz2
combine.c (record_value_for_reg): Change 0 to VOIDmode, twice.
gcc/: * combine.c (record_value_for_reg): Change 0 to VOIDmode, twice. (record_dead_and_set_regs): Likewise. * df.h (struct df_mw_hardreg): Change flags field to int. (struct df_base_ref): Likewise. (struct df): Change changeable_flags field to int. * df-scan.c (df_defs_record): Change clobber_flags to int. * dwarf2.h (enum dwarf_tag): Make lo_user and hi_user values enum constants rather than #define macros. (enum dwarf_attribute, enum dwarf_location_atom): Likewise. (enum dwarf_type, enum dwarf_endianity_encoding): Likewise. (enum dwarf_calling_convention): Likewise. (enum dwarf_line_number_x_ops): Likewise. (enum dwarf_call_frame_info): Likewise. (enum dwarf_source_language): Likewise. * dwarf2out.c (int_loc_descriptor): Add cast to enum type. (add_calling_convention_attribute): Likewise. * fold-const.c (fold_undefer_overflow_warnings): Add cast to enum type. (combine_comparisons): Change compcode to int. Add cast to enum type. * genrecog.c (maybe_both_true_2): Change c to int. (write_switch): Likewise. Add cast to enum type. * gimplify.c (gimplify_omp_for): Handle return values from gimplify_expr using MIN rather than bitwise or. (gimplify_expr): Add cast to enum type. * ipa-prop.c (update_jump_functions_after_inlining): Change IPA_BOTTOM to IPA_JF_UNKNOWN. * ira.c (setup_class_subset_and_memory_move_costs): Change mode to int. Add casts to enum type. (setup_cover_and_important_classes): Change cl to int. Add casts to enum type. (setup_class_translate): Change cl and mode to int. (ira_init_once): Change mode to int. (free_register_move_costs): Likewise. (setup_prohibited_mode_move_regs): Add casts to enum type. * langhooks.c (add_builtin_function_common): Rework assertion that value fits bitfield. * mcf.c (add_fixup_edge): Change type parameter to edge_type. * omega.c (omega_do_elimination): Avoid math on enum types. * optabs.c (expand_vec_shift_expr): Remove casts to int. * opts.c (set_debug_level): Change 2 to enum constant. Use new int local to handle integral_argment value. * regmove.c (try_auto_increment): Change PUT_MODE to PUT_REG_NOTE_KIND. * reload.c (push_secondary_reload): Add casts to enum type. (secondary_reload_class, find_valid_class): Likewise. * reload1.c (emit_input_reload_insns): Likewise. * rtl.h (NOTE_VAR_LOCATION_STATUS): Likewise. * sel-sched.c (init_hard_regs_data): Change cur_mode to int. * sel-sched-ir.c (hash_with_unspec_callback): Change 0 to enum constant. * tree.c (build_common_builtin_nodes): Add casts to enum type. * tree-complex.c (complex_lattice_t): Typedef to int rather than enum type. (expand_complex_libcall): Add casts to enum type. * tree-into-ssa.c (get_ssa_name_ann): Change 0 to enum constant. * tree-vect-loop.c (vect_model_reduction_cost): Compare reduc_code with ERROR_MARK, not NUM_TREE_CODES. (vect_create_epilog_for_reduction): Likewise. (vectorizable_reduction): Don't initialize epiloc_reduc_code. When not using it, set it to ERROR_MARK rather than NUM_TREE_CODES. * tree-vect-patterns.c (vect_pattern_recog_1): Change vec_mode to enum machine_mode. * tree-vect-stmts.c (new_stmt_vec_info): Change 0 to vect_unused_in_loop. Change 0 to loop_vect. * tree-vectorizer.c (vect_set_verbosity_level): Add casts to enum type. * var-tracking.c (get_init_value): Change return type to enum var_init_status. * vec.h (DEF_VEC_FUNC_P) [iterate]: Cast 0 to type T. * config/arm/arm.c (fp_model_for_fpu): Change to array to enum arm_fp_model. (arm_override_options): Add casts to enum type. (arm_emit_tls_decoration): Likewise. * config/i386/i386.c (ix86_function_specific_restore): Add casts to enum type. * config/i386/i386-c.c (ix86_pragma_target_parse): Likewise. * config/ia64/ia64.c (ia64_expand_compare): Change magic to int. * config/rs6000/rs6000.c (rs6000_override_options): Add casts to enum type. * config/s390/s390.c (code_for_builtin_64): Change to array of enum insn_code. (code_for_builtin_31): Likewise. (s390_expand_builtin): Change code_for_builtin to enum insn_code const *. * config/sparc/sparc.c (sparc_override_options): Change value field in struct code_model to enum cmodel. In initializer change 0 to NULL and add cast to enum type. * c-typeck.c (build_modify_expr): Add lhs_origtype parameter. Change all callers. Issue a -Wc++-compat warning using lhs_origtype if necessary. (convert_for_assignment): Issue -Wc++-compat warnings about invalid conversions to enum type on assignment. * c-common.h (build_modify_expr): Update declaration. gcc/cp/: * call.c (build_temp): Change 0 to enum constant. * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum type. * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type. * decl2.c (constrain_visibility): Likewise. * parser.c (cp_lexer_get_preprocessor_token): Likewise. (cp_parser_flags): Typedef to int rather than enum type. (cp_parser_expression_stack_entry): Change prec field to enum cp_parser_prec. * typeck.c (build_modify_expr): Add lhs_origtype parameter. Change all callers. gcc/fortran/: * gfortran.h (enum gfc_symbol_type): New named enum type, broken out of struct gfc_symbol. (struct gfc_symbol): Use enum gfc_symbol_type. (enum gfc_array_ref_dimen_type): New named enum type, broken out of struct gfc_array_ref). (struct gfc_array_ref): Use enum gfc_array_ref_dimen_type. (mod_pointee_as): Update declaration. * decl.c (add_global_entry): Change type to enum gfc_symbol_type. (gfc_mod_pointee_as): Change return type to "match". * module.c (mio_array_ref): Add cast to enum type. (mio_symbol): Likewise. * resolve.c (resolve_global_procedure): Change type to enum gfc_symbol_type. * trans-io.c (gfc_build_st_parameter): Change type to unsigned int. gcc/java/: * jcf-parse.c (handle_constant): Add cast to enum type. gcc/objc/: * objc-act.c (get_super_receiver): Update calls to build_modify_expr to pass new argument. gcc/testsuite/: * gcc.dg/Wcxx-compat-4.c: New testcase. From-SVN: r146735
Diffstat (limited to 'gcc/ira.c')
-rw-r--r--gcc/ira.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/gcc/ira.c b/gcc/ira.c
index df5e795..1b8c84b 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -503,8 +503,7 @@ setup_alloc_regs (bool use_hard_frame_p)
static void
setup_class_subset_and_memory_move_costs (void)
{
- int cl, cl2;
- enum machine_mode mode;
+ int cl, cl2, mode;
HARD_REG_SET temp_hard_regset2;
for (mode = 0; mode < MAX_MACHINE_MODE; mode++)
@@ -516,9 +515,11 @@ setup_class_subset_and_memory_move_costs (void)
for (mode = 0; mode < MAX_MACHINE_MODE; mode++)
{
ira_memory_move_cost[mode][cl][0] =
- MEMORY_MOVE_COST (mode, (enum reg_class) cl, 0);
+ MEMORY_MOVE_COST ((enum machine_mode) mode,
+ (enum reg_class) cl, 0);
ira_memory_move_cost[mode][cl][1] =
- MEMORY_MOVE_COST (mode, (enum reg_class) cl, 1);
+ MEMORY_MOVE_COST ((enum machine_mode) mode,
+ (enum reg_class) cl, 1);
/* Costs for NO_REGS are used in cost calculation on the
1st pass when the preferred register classes are not
known yet. In this case we take the best scenario. */
@@ -727,9 +728,8 @@ int ira_important_class_nums[N_REG_CLASSES];
static void
setup_cover_and_important_classes (void)
{
- int i, j, n;
+ int i, j, n, cl;
bool set_p, eq_p;
- enum reg_class cl;
const enum reg_class *cover_classes;
HARD_REG_SET temp_hard_regset2;
static enum reg_class classes[LIM_REG_CLASSES + 1];
@@ -743,7 +743,7 @@ setup_cover_and_important_classes (void)
else
{
for (i = 0; (cl = cover_classes[i]) != LIM_REG_CLASSES; i++)
- classes[i] = cl;
+ classes[i] = (enum reg_class) cl;
classes[i] = LIM_REG_CLASSES;
}
@@ -756,7 +756,7 @@ setup_cover_and_important_classes (void)
continue;
#ifdef CONSTRAINT__LIMIT
for (j = 0; j < CONSTRAINT__LIMIT; j++)
- if ((int) regclass_for_constraint (j) == i)
+ if ((int) regclass_for_constraint ((enum constraint_num) j) == i)
break;
if (j < CONSTRAINT__LIMIT)
{
@@ -778,7 +778,7 @@ setup_cover_and_important_classes (void)
break;
}
if (j >= i)
- classes[n++] = i;
+ classes[n++] = (enum reg_class) i;
}
classes[n] = LIM_REG_CLASSES;
}
@@ -788,12 +788,12 @@ setup_cover_and_important_classes (void)
{
for (j = 0; j < i; j++)
if (flag_ira_algorithm != IRA_ALGORITHM_PRIORITY
- && reg_classes_intersect_p (cl, classes[j]))
+ && reg_classes_intersect_p ((enum reg_class) cl, classes[j]))
gcc_unreachable ();
COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]);
AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
if (! hard_reg_set_empty_p (temp_hard_regset))
- ira_reg_class_cover[ira_reg_class_cover_size++] = cl;
+ ira_reg_class_cover[ira_reg_class_cover_size++] = (enum reg_class) cl;
}
ira_important_classes_num = 0;
for (cl = 0; cl < N_REG_CLASSES; cl++)
@@ -810,7 +810,7 @@ setup_cover_and_important_classes (void)
COPY_HARD_REG_SET (temp_hard_regset2,
reg_class_contents[ira_reg_class_cover[j]]);
AND_COMPL_HARD_REG_SET (temp_hard_regset2, no_unit_alloc_regs);
- if (cl == ira_reg_class_cover[j])
+ if ((enum reg_class) cl == ira_reg_class_cover[j])
{
eq_p = false;
set_p = true;
@@ -826,7 +826,8 @@ setup_cover_and_important_classes (void)
if (set_p && ! eq_p)
{
ira_important_class_nums[cl] = ira_important_classes_num;
- ira_important_classes[ira_important_classes_num++] = cl;
+ ira_important_classes[ira_important_classes_num++] =
+ (enum reg_class) cl;
}
}
}
@@ -841,8 +842,8 @@ enum reg_class ira_class_translate[N_REG_CLASSES];
static void
setup_class_translate (void)
{
- enum reg_class cl, cover_class, best_class, *cl_ptr;
- enum machine_mode mode;
+ int cl, mode;
+ enum reg_class cover_class, best_class, *cl_ptr;
int i, cost, min_cost, best_cost;
for (cl = 0; cl < N_REG_CLASSES; cl++)
@@ -1225,7 +1226,7 @@ ira_init_register_move_cost (enum machine_mode mode)
void
ira_init_once (void)
{
- enum machine_mode mode;
+ int mode;
for (mode = 0; mode < MAX_MACHINE_MODE; mode++)
{
@@ -1241,7 +1242,7 @@ ira_init_once (void)
static void
free_register_move_costs (void)
{
- enum machine_mode mode;
+ int mode;
for (mode = 0; mode < MAX_MACHINE_MODE; mode++)
{
@@ -1311,9 +1312,9 @@ setup_prohibited_mode_move_regs (void)
if (! HARD_REGNO_MODE_OK (j, (enum machine_mode) i))
continue;
SET_REGNO (test_reg1, j);
- PUT_MODE (test_reg1, i);
+ PUT_MODE (test_reg1, (enum machine_mode) i);
SET_REGNO (test_reg2, j);
- PUT_MODE (test_reg2, i);
+ PUT_MODE (test_reg2, (enum machine_mode) i);
INSN_CODE (move_insn) = -1;
recog_memoized (move_insn);
if (INSN_CODE (move_insn) < 0)