aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/arm
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2009-04-20 19:35:00 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2009-04-20 19:35:00 +0000
commitbbbbb16a888987aea0b85ce1133cf1dac4557ecc (patch)
treed88108cb1bacca1da6cfae95a807a42f3c5f612b /gcc/config/arm
parentc2efda0dee082ae3f57bdb2c7b1ae2dbf07ddfcd (diff)
downloadgcc-bbbbb16a888987aea0b85ce1133cf1dac4557ecc.zip
gcc-bbbbb16a888987aea0b85ce1133cf1dac4557ecc.tar.gz
gcc-bbbbb16a888987aea0b85ce1133cf1dac4557ecc.tar.bz2
Fix enum conversions which are invalid in C++:
gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
Diffstat (limited to 'gcc/config/arm')
-rw-r--r--gcc/config/arm/arm-protos.h6
-rw-r--r--gcc/config/arm/arm-tune.md2
-rw-r--r--gcc/config/arm/arm.c43
-rw-r--r--gcc/config/arm/arm.h2
-rwxr-xr-xgcc/config/arm/gentune.sh2
5 files changed, 26 insertions, 29 deletions
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index 8d03141..6019dc6 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -1,6 +1,6 @@
/* Prototypes for exported functions defined in arm.c and pe.c
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
- Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+ 2009 Free Software Foundation, Inc.
Contributed by Richard Earnshaw (rearnsha@arm.com)
Minor hacks by Nick Clifton (nickc@cygnus.com)
@@ -26,7 +26,7 @@
extern void arm_override_options (void);
extern void arm_optimization_options (int, int);
extern int use_return_insn (int, rtx);
-extern int arm_regno_class (int);
+extern enum reg_class arm_regno_class (int);
extern void arm_load_pic_register (unsigned long);
extern int arm_volatile_func (void);
extern const char *arm_output_epilogue (rtx);
diff --git a/gcc/config/arm/arm-tune.md b/gcc/config/arm/arm-tune.md
index ea728dc..4d8ae2f 100644
--- a/gcc/config/arm/arm-tune.md
+++ b/gcc/config/arm/arm-tune.md
@@ -2,4 +2,4 @@
;; Generated automatically by gentune.sh from arm-cores.def
(define_attr "tune"
"arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7d,arm7di,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7m,arm7dm,arm7dmi,arm8,arm810,strongarm,strongarm110,strongarm1100,strongarm1110,arm7tdmi,arm7tdmis,arm710t,arm720t,arm740t,arm9,arm9tdmi,arm920,arm920t,arm922t,arm940t,ep9312,arm10tdmi,arm1020t,arm9e,arm946es,arm966es,arm968es,arm10e,arm1020e,arm1022e,xscale,iwmmxt,iwmmxt2,arm926ejs,arm1026ejs,arm1136js,arm1136jfs,arm1176jzs,arm1176jzfs,mpcorenovfp,mpcore,arm1156t2s,cortexa8,cortexa9,cortexr4,cortexr4f,cortexm3,cortexm1"
- (const (symbol_ref "arm_tune")))
+ (const (symbol_ref "((enum attr_tune) arm_tune)")))
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 9bd9624..80d1267 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -4784,7 +4784,7 @@ thumb_legitimize_reload_address (rtx *x_p,
x = copy_rtx (x);
push_reload (orig_x, NULL_RTX, x_p, NULL, MODE_BASE_REG_CLASS (mode),
- Pmode, VOIDmode, 0, 0, opnum, type);
+ Pmode, VOIDmode, 0, 0, opnum, (enum reload_type) type);
return x;
}
@@ -4801,7 +4801,7 @@ thumb_legitimize_reload_address (rtx *x_p,
x = copy_rtx (x);
push_reload (orig_x, NULL_RTX, x_p, NULL, MODE_BASE_REG_CLASS (mode),
- Pmode, VOIDmode, 0, 0, opnum, type);
+ Pmode, VOIDmode, 0, 0, opnum, (enum reload_type) type);
return x;
}
@@ -5465,7 +5465,7 @@ arm_rtx_costs_1 (rtx x, enum rtx_code outer, int* total, bool speed)
return true;
case ABS:
- if (GET_MODE_CLASS (mode == MODE_FLOAT))
+ if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
if (TARGET_HARD_FLOAT && (mode == SFmode || mode == DFmode))
{
@@ -5821,10 +5821,12 @@ arm_rtx_costs (rtx x, int code, int outer_code, int *total,
bool speed)
{
if (!speed)
- return arm_size_rtx_costs (x, code, outer_code, total);
+ return arm_size_rtx_costs (x, (enum rtx_code) code,
+ (enum rtx_code) outer_code, total);
else
- return all_cores[(int)arm_tune].rtx_costs (x, code, outer_code, total,
- speed);
+ return all_cores[(int)arm_tune].rtx_costs (x, (enum rtx_code) code,
+ (enum rtx_code) outer_code,
+ total, speed);
}
/* RTX costs for cores with a slow MUL implementation. Thumb-2 is not
@@ -7408,7 +7410,7 @@ adjacent_mem_locations (rtx a, rtx b)
/* Don't accept any offset that will require multiple
instructions to handle, since this would cause the
arith_adjacentmem pattern to output an overlong sequence. */
- if (!const_ok_for_op (PLUS, val0) || !const_ok_for_op (PLUS, val1))
+ if (!const_ok_for_op (val0, PLUS) || !const_ok_for_op (val1, PLUS))
return 0;
/* Don't allow an eliminable register: register elimination can make
@@ -10214,8 +10216,7 @@ vfp_emit_fstmd (int base_reg, int count)
}
par = emit_insn (par);
- REG_NOTES (par) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
- REG_NOTES (par));
+ add_reg_note (par, REG_FRAME_RELATED_EXPR, dwarf);
RTX_FRAME_RELATED_P (par) = 1;
return count * 8;
@@ -12498,8 +12499,8 @@ emit_multi_reg_push (unsigned long mask)
RTX_FRAME_RELATED_P (tmp) = 1;
XVECEXP (dwarf, 0, 0) = tmp;
- REG_NOTES (par) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
- REG_NOTES (par));
+ add_reg_note (par, REG_FRAME_RELATED_EXPR, dwarf);
+
return par;
}
@@ -12565,8 +12566,8 @@ emit_sfm (int base_reg, int count)
XVECEXP (dwarf, 0, 0) = tmp;
par = emit_insn (par);
- REG_NOTES (par) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
- REG_NOTES (par));
+ add_reg_note (par, REG_FRAME_RELATED_EXPR, dwarf);
+
return par;
}
@@ -12985,8 +12986,7 @@ thumb_set_frame_pointer (arm_stack_offsets *offsets)
dwarf = gen_rtx_SET (VOIDmode, hard_frame_pointer_rtx,
plus_constant (stack_pointer_rtx, amount));
RTX_FRAME_RELATED_P (dwarf) = 1;
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
- REG_NOTES (insn));
+ add_reg_note (insn, REG_FRAME_RELATED_EXPR, dwarf);
}
RTX_FRAME_RELATED_P (insn) = 1;
@@ -13049,8 +13049,7 @@ arm_expand_prologue (void)
dwarf = gen_rtx_SET (VOIDmode, r0, dwarf);
insn = gen_movsi (r0, stack_pointer_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- dwarf, REG_NOTES (insn));
+ add_reg_note (insn, REG_FRAME_RELATED_EXPR, dwarf);
emit_insn (insn);
emit_insn (gen_andsi3 (r1, r0, GEN_INT (~(HOST_WIDE_INT)7)));
emit_insn (gen_movsi (stack_pointer_rtx, r1));
@@ -13117,8 +13116,7 @@ arm_expand_prologue (void)
plus_constant (stack_pointer_rtx,
-fp_offset));
RTX_FRAME_RELATED_P (insn) = 1;
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
- dwarf, REG_NOTES (insn));
+ add_reg_note (insn, REG_FRAME_RELATED_EXPR, dwarf);
}
else
{
@@ -14670,7 +14668,8 @@ arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode)
/* For efficiency and historical reasons LO_REGS, HI_REGS and CC_REGS are
not used in arm mode. */
-int
+
+enum reg_class
arm_regno_class (int regno)
{
if (TARGET_THUMB1)
@@ -17631,9 +17630,7 @@ thumb1_expand_prologue (void)
plus_constant (stack_pointer_rtx,
-amount));
RTX_FRAME_RELATED_P (dwarf) = 1;
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
- REG_NOTES (insn));
+ add_reg_note (insn, REG_FRAME_RELATED_EXPR, dwarf);
}
}
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index a44b403..b55c65c 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1915,7 +1915,7 @@ typedef struct
TARGET_32BIT ? 12 : 16)), \
FNADDR); \
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \
- 0, VOIDmode, 2, TRAMP, Pmode, \
+ LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \
plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode); \
}
#endif
diff --git a/gcc/config/arm/gentune.sh b/gcc/config/arm/gentune.sh
index 40c0541..7c309c7 100755
--- a/gcc/config/arm/gentune.sh
+++ b/gcc/config/arm/gentune.sh
@@ -9,4 +9,4 @@ allcores=`awk -F'[(, ]+' '/^ARM_CORE/ { cores = cores$3"," } END { print cores
echo "(define_attr \"tune\""
echo " \"$allcores\"" | sed -e 's/,"$/"/'
-echo " (const (symbol_ref \"arm_tune\")))"
+echo " (const (symbol_ref \"((enum attr_tune) arm_tune)\")))"