diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-20 19:35:00 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-20 19:35:00 +0000 |
commit | b9c74b4dc40904cbb3882d1c245d4eeae24139f4 (patch) | |
tree | d88108cb1bacca1da6cfae95a807a42f3c5f612b /gcc/config | |
parent | ca4d41c4e30758a7b130cfb5c382d6831f1dddf1 (diff) | |
download | gcc-b9c74b4dc40904cbb3882d1c245d4eeae24139f4.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146451 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/arm/arm-protos.h | 6 | ||||
-rw-r--r-- | gcc/config/arm/arm-tune.md | 2 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 43 | ||||
-rw-r--r-- | gcc/config/arm/arm.h | 2 | ||||
-rwxr-xr-x | gcc/config/arm/gentune.sh | 2 | ||||
-rw-r--r-- | gcc/config/i386/i386-c.c | 6 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 28 | ||||
-rw-r--r-- | gcc/config/i386/i386.md | 16 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.c | 65 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.md | 11 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 35 | ||||
-rw-r--r-- | gcc/config/mips/mips.h | 2 | ||||
-rw-r--r-- | gcc/config/mips/sdemtk.h | 4 | ||||
-rw-r--r-- | gcc/config/pa/pa.c | 50 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000-c.c | 50 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 46 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 66 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.c | 19 | ||||
-rw-r--r-- | gcc/config/spu/spu-c.c | 22 | ||||
-rw-r--r-- | gcc/config/spu/spu-protos.h | 4 | ||||
-rw-r--r-- | gcc/config/spu/spu.c | 13 |
22 files changed, 224 insertions, 270 deletions
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index 8d03141e44b..6019dc697df 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 ea728dcb67c..4d8ae2f11bc 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 9bd9624eb2e..80d12676ca0 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 a44b40388d7..b55c65cf16d 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 40c05411052..7c309c75f55 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)\")))" diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c index 0c59b2fef6c..d35ea7626a7 100644 --- a/gcc/config/i386/i386-c.c +++ b/gcc/config/i386/i386-c.c @@ -1,5 +1,5 @@ /* Subroutines used for macro/preprocessor support on the ia-32. - Copyright (C) 2008 + Copyright (C) 2008, 2009 Free Software Foundation, Inc. This file is part of GCC. @@ -297,14 +297,14 @@ ix86_pragma_target_parse (tree args, tree pop_target) ix86_target_macros_internal (prev_isa & diff_isa, prev_arch, prev_tune, - prev_opt->fpmath, + (enum fpmath_unit) prev_opt->fpmath, cpp_undef); /* Define all of the macros for new options that were just turned on. */ ix86_target_macros_internal (cur_isa & diff_isa, cur_arch, cur_tune, - cur_opt->fpmath, + (enum fpmath_unit) cur_opt->fpmath, cpp_define); return true; diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 5af19514f90..6e60fb7e70b 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -8333,8 +8333,7 @@ ix86_expand_prologue (void) RTX_FRAME_RELATED_P (insn) = 1; t = gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (-allocate)); t = gen_rtx_SET (VOIDmode, stack_pointer_rtx, t); - REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - t, REG_NOTES (insn)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, t); if (eax_live) { @@ -14886,20 +14885,14 @@ ix86_split_fp_branch (enum rtx_code code, rtx op1, rtx op2, label), pc_rtx))); if (bypass_probability >= 0) - REG_NOTES (i) - = gen_rtx_EXPR_LIST (REG_BR_PROB, - GEN_INT (bypass_probability), - REG_NOTES (i)); + add_reg_note (i, REG_BR_PROB, GEN_INT (bypass_probability)); } i = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, gen_rtx_IF_THEN_ELSE (VOIDmode, condition, target1, target2))); if (probability >= 0) - REG_NOTES (i) - = gen_rtx_EXPR_LIST (REG_BR_PROB, - GEN_INT (probability), - REG_NOTES (i)); + add_reg_note (i, REG_BR_PROB, GEN_INT (probability)); if (second != NULL_RTX) { i = emit_jump_insn (gen_rtx_SET @@ -14907,10 +14900,7 @@ ix86_split_fp_branch (enum rtx_code code, rtx op1, rtx op2, gen_rtx_IF_THEN_ELSE (VOIDmode, second, target1, target2))); if (second_probability >= 0) - REG_NOTES (i) - = gen_rtx_EXPR_LIST (REG_BR_PROB, - GEN_INT (second_probability), - REG_NOTES (i)); + add_reg_note (i, REG_BR_PROB, GEN_INT (second_probability)); } if (label != NULL_RTX) emit_label (label); @@ -17108,10 +17098,7 @@ predict_jump (int prob) { rtx insn = get_last_insn (); gcc_assert (JUMP_P (insn)); - REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_BR_PROB, - GEN_INT (prob), - REG_NOTES (insn)); + add_reg_note (insn, REG_BR_PROB, GEN_INT (prob)); } /* Helper function for the string operations below. Dest VARIABLE whether @@ -23914,7 +23901,7 @@ ix86_expand_binop_builtin (enum insn_code icode, tree exp, rtx target) static rtx ix86_expand_multi_arg_builtin (enum insn_code icode, tree exp, rtx target, enum multi_arg_type m_type, - enum insn_code sub_code) + enum rtx_code sub_code) { rtx pat; int i; @@ -25401,7 +25388,8 @@ ix86_builtin_vectorized_function (unsigned int fn, tree type_out, /* Dispatch to a handler for a vectorization library. */ if (ix86_veclib_handler) - return (*ix86_veclib_handler)(fn, type_out, type_in); + return (*ix86_veclib_handler) ((enum built_in_function) fn, type_out, + type_in); return NULL_TREE; } diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 679d38a8a89..777a72cb9a6 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -4375,7 +4375,9 @@ ; else { - int slot = virtuals_instantiated ? SLOT_TEMP : SLOT_VIRTUAL; + enum ix86_stack_slot slot = (virtuals_instantiated + ? SLOT_TEMP + : SLOT_VIRTUAL); rtx temp = assign_386_stack_local (SFmode, slot); emit_insn (gen_truncdfsf2_with_temp (operands[0], operands[1], temp)); DONE; @@ -4560,7 +4562,9 @@ } else { - int slot = virtuals_instantiated ? SLOT_TEMP : SLOT_VIRTUAL; + enum ix86_stack_slot slot = (virtuals_instantiated + ? SLOT_TEMP + : SLOT_VIRTUAL); operands[2] = assign_386_stack_local (<MODE>mode, slot); } }) @@ -5730,7 +5734,9 @@ } else { - int slot = virtuals_instantiated ? SLOT_TEMP : SLOT_VIRTUAL; + enum ix86_stack_slot slot = (virtuals_instantiated + ? SLOT_TEMP + : SLOT_VIRTUAL); operands[2] = assign_386_stack_local (DImode, slot); } }) @@ -18984,7 +18990,9 @@ emit_insn (gen_fxam<mode>2_i387_with_temp (scratch, operands[1])); else { - int slot = virtuals_instantiated ? SLOT_TEMP : SLOT_VIRTUAL; + enum ix86_stack_slot slot = (virtuals_instantiated + ? SLOT_TEMP + : SLOT_VIRTUAL); rtx temp = assign_386_stack_local (<MODE>mode, slot); emit_move_insn (temp, operands[1]); diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 66ef5a84e07..7cccb6be2cc 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -1311,9 +1311,7 @@ ia64_split_tmode_move (rtx operands[]) && (GET_CODE (XEXP (EXP, 0)) == POST_MODIFY \ || GET_CODE (XEXP (EXP, 0)) == POST_INC \ || GET_CODE (XEXP (EXP, 0)) == POST_DEC)) \ - REG_NOTES (INSN) = gen_rtx_EXPR_LIST (REG_INC, \ - XEXP (XEXP (EXP, 0), 0), \ - REG_NOTES (INSN)) + add_reg_note (insn, REG_INC, XEXP (XEXP (EXP, 0), 0)) insn = emit_insn (gen_rtx_SET (VOIDmode, out[0], in[0])); MAYBE_ADD_REG_INC_NOTE (insn, in[0]); @@ -2770,9 +2768,8 @@ spill_restore_mem (rtx reg, HOST_WIDE_INT cfa_off) gen_rtx_PLUS (DImode, spill_fill_data.iter_reg[iter], disp_rtx)); - REG_NOTES (spill_fill_data.prev_insn[iter]) - = gen_rtx_EXPR_LIST (REG_INC, spill_fill_data.iter_reg[iter], - REG_NOTES (spill_fill_data.prev_insn[iter])); + add_reg_note (spill_fill_data.prev_insn[iter], + REG_INC, spill_fill_data.iter_reg[iter]); } else { @@ -2889,13 +2886,11 @@ do_spill (rtx (*move_fn) (rtx, rtx, rtx), rtx reg, HOST_WIDE_INT cfa_off, off = current_frame_info.total_size - cfa_off; } - REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - gen_rtx_SET (VOIDmode, - gen_rtx_MEM (GET_MODE (reg), - plus_constant (base, off)), - frame_reg), - REG_NOTES (insn)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, + gen_rtx_SET (VOIDmode, + gen_rtx_MEM (GET_MODE (reg), + plus_constant (base, off)), + frame_reg)); } } @@ -3095,16 +3090,12 @@ ia64_expand_prologue (void) { RTX_FRAME_RELATED_P (insn) = 1; if (GET_CODE (offset) != CONST_INT) - { - REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - gen_rtx_SET (VOIDmode, - stack_pointer_rtx, - gen_rtx_PLUS (DImode, - stack_pointer_rtx, - frame_size_rtx)), - REG_NOTES (insn)); - } + add_reg_note (insn, REG_FRAME_RELATED_EXPR, + gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + gen_rtx_PLUS (DImode, + stack_pointer_rtx, + frame_size_rtx))); } /* ??? At this point we must generate a magic insn that appears to @@ -3171,10 +3162,8 @@ ia64_expand_prologue (void) /* ??? Denote pr spill/fill by a DImode move that modifies all 64 hard registers. */ RTX_FRAME_RELATED_P (insn) = 1; - REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - gen_rtx_SET (VOIDmode, alt_reg, reg), - REG_NOTES (insn)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, + gen_rtx_SET (VOIDmode, alt_reg, reg)); /* Even if we're not going to generate an epilogue, we still need to save the register so that EH works. */ @@ -3533,16 +3522,12 @@ ia64_expand_epilogue (int sibcall_p) RTX_FRAME_RELATED_P (insn) = 1; if (GET_CODE (offset) != CONST_INT) - { - REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - gen_rtx_SET (VOIDmode, - stack_pointer_rtx, - gen_rtx_PLUS (DImode, - stack_pointer_rtx, - frame_size_rtx)), - REG_NOTES (insn)); - } + add_reg_note (insn, REG_FRAME_RELATED_EXPR, + gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + gen_rtx_PLUS (DImode, + stack_pointer_rtx, + frame_size_rtx))); } if (cfun->machine->ia64_eh_epilogue_bsp) @@ -7931,7 +7916,7 @@ insert_bundle_state (struct bundle_state *bundle_state) { void **entry_ptr; - entry_ptr = htab_find_slot (bundle_state_table, bundle_state, 1); + entry_ptr = htab_find_slot (bundle_state_table, bundle_state, INSERT); if (*entry_ptr == NULL) { bundle_state->next = index_to_bundle_states [bundle_state->insn_num]; @@ -8295,9 +8280,7 @@ ia64_add_bundle_selector_before (int template0, rtx insn) if (find_reg_note (insn, REG_EH_REGION, NULL_RTX)) note = NULL_RTX; else - REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_EH_REGION, XEXP (note, 0), - REG_NOTES (insn)); + add_reg_note (insn, REG_EH_REGION, XEXP (note, 0)); } } } diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md index 7c09236d045..51a01e4e15e 100644 --- a/gcc/config/ia64/ia64.md +++ b/gcc/config/ia64/ia64.md @@ -1,6 +1,6 @@ ;; IA-64 Machine description template -;; 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 James E. Wilson <wilson@cygnus.com> and ;; David Mosberger <davidm@hpl.hp.com>. @@ -116,7 +116,8 @@ ;; Processor type. This attribute must exactly match the processor_type ;; enumeration in ia64.h. -(define_attr "cpu" "itanium,itanium2" (const (symbol_ref "ia64_tune"))) +(define_attr "cpu" "itanium,itanium2" + (const (symbol_ref "((enum attr_cpu) ia64_tune)"))) ;; Instruction type. This primarily determines how instructions can be ;; packed in bundles, and secondarily affects scheduling to function units. @@ -6076,7 +6077,7 @@ { emit_library_call (gen_rtx_SYMBOL_REF (Pmode, \"__ia64_save_stack_nonlocal\"), - 0, VOIDmode, 2, XEXP (operands[0], 0), Pmode, + LCT_NORMAL, VOIDmode, 2, XEXP (operands[0], 0), Pmode, operands[1], Pmode); DONE; }) @@ -6154,7 +6155,7 @@ { emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__ia64_restore_stack_nonlocal"), - 0, VOIDmode, 1, + LCT_NORMAL, VOIDmode, 1, copy_to_reg (XEXP (operands[1], 0)), Pmode); DONE; }) diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index ca727ad12e5..8e3cdcfa6d8 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -3312,7 +3312,7 @@ mips_binary_cost (rtx x, int single_cost, int double_cost) else cost = single_cost; return (cost - + rtx_cost (XEXP (x, 0), 0, !optimize_size) + + rtx_cost (XEXP (x, 0), SET, !optimize_size) + rtx_cost (XEXP (x, 1), GET_CODE (x), !optimize_size)); } @@ -3531,7 +3531,7 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total, && UINTVAL (XEXP (x, 1)) == 0xffffffff) { *total = (mips_zero_extend_cost (mode, XEXP (x, 0)) - + rtx_cost (XEXP (x, 0), 0, speed)); + + rtx_cost (XEXP (x, 0), SET, speed)); return true; } /* Fall through. */ @@ -3563,7 +3563,7 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total, case LO_SUM: /* Low-part immediates need an extended MIPS16 instruction. */ *total = (COSTS_N_INSNS (TARGET_MIPS16 ? 2 : 1) - + rtx_cost (XEXP (x, 0), 0, speed)); + + rtx_cost (XEXP (x, 0), SET, speed)); return true; case LT: @@ -3603,17 +3603,17 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total, if (GET_CODE (op0) == MULT && GET_CODE (XEXP (op0, 0)) == NEG) { *total = (mips_fp_mult_cost (mode) - + rtx_cost (XEXP (XEXP (op0, 0), 0), 0, speed) - + rtx_cost (XEXP (op0, 1), 0, speed) - + rtx_cost (op1, 0, speed)); + + rtx_cost (XEXP (XEXP (op0, 0), 0), SET, speed) + + rtx_cost (XEXP (op0, 1), SET, speed) + + rtx_cost (op1, SET, speed)); return true; } if (GET_CODE (op1) == MULT) { *total = (mips_fp_mult_cost (mode) - + rtx_cost (op0, 0, speed) - + rtx_cost (XEXP (op1, 0), 0, speed) - + rtx_cost (XEXP (op1, 1), 0, speed)); + + rtx_cost (op0, SET, speed) + + rtx_cost (XEXP (op1, 0), SET, speed) + + rtx_cost (XEXP (op1, 1), SET, speed)); return true; } } @@ -3654,9 +3654,9 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total, && GET_CODE (XEXP (op, 0)) == MULT) { *total = (mips_fp_mult_cost (mode) - + rtx_cost (XEXP (XEXP (op, 0), 0), 0, speed) - + rtx_cost (XEXP (XEXP (op, 0), 1), 0, speed) - + rtx_cost (XEXP (op, 1), 0, speed)); + + rtx_cost (XEXP (XEXP (op, 0), 0), SET, speed) + + rtx_cost (XEXP (XEXP (op, 0), 1), SET, speed) + + rtx_cost (XEXP (op, 1), SET, speed)); return true; } } @@ -3694,9 +3694,10 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total, if (outer_code == SQRT || GET_CODE (XEXP (x, 1)) == SQRT) /* An rsqrt<mode>a or rsqrt<mode>b pattern. Count the division as being free. */ - *total = rtx_cost (XEXP (x, 1), 0, speed); + *total = rtx_cost (XEXP (x, 1), SET, speed); else - *total = mips_fp_div_cost (mode) + rtx_cost (XEXP (x, 1), 0, speed); + *total = (mips_fp_div_cost (mode) + + rtx_cost (XEXP (x, 1), SET, speed)); return true; } /* Fall through. */ @@ -3724,7 +3725,7 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total, && CONST_INT_P (XEXP (x, 1)) && exact_log2 (INTVAL (XEXP (x, 1))) >= 0) { - *total = COSTS_N_INSNS (2) + rtx_cost (XEXP (x, 0), 0, speed); + *total = COSTS_N_INSNS (2) + rtx_cost (XEXP (x, 0), SET, speed); return true; } *total = COSTS_N_INSNS (mips_idiv_insns ()); @@ -14465,8 +14466,8 @@ mips_override_options (void) /* Set up mips_hard_regno_mode_ok. */ for (mode = 0; mode < MAX_MACHINE_MODE; mode++) for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) - mips_hard_regno_mode_ok[(int)mode][regno] - = mips_hard_regno_mode_ok_p (regno, mode); + mips_hard_regno_mode_ok[mode][regno] + = mips_hard_regno_mode_ok_p (regno, (enum machine_mode) mode); /* Function to allocate machine-dependent function status. */ init_machine_status = &mips_init_machine_status; diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index cd6f1e5d220..30faa196a52 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -2441,7 +2441,7 @@ typedef struct mips_args { /* Flush both caches. We need to flush the data cache in case \ the system has a write-back cache. */ \ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mips_cache_flush_func), \ - 0, VOIDmode, 3, ADDR, Pmode, SIZE, Pmode, \ + LCT_NORMAL, VOIDmode, 3, ADDR, Pmode, SIZE, Pmode, \ GEN_INT (3), TYPE_MODE (integer_type_node)) /* A C statement to initialize the variable parts of a trampoline. diff --git a/gcc/config/mips/sdemtk.h b/gcc/config/mips/sdemtk.h index 3e4e58fdd4f..adaaa25e6cd 100644 --- a/gcc/config/mips/sdemtk.h +++ b/gcc/config/mips/sdemtk.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. MIPS SDE version, for use with the SDE C library rather than newlib. - Copyright (C) 2007, 2008 + Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GCC. @@ -86,7 +86,7 @@ extern void mips_sync_icache (void *beg, unsigned long len); #undef MIPS_ICACHE_SYNC #define MIPS_ICACHE_SYNC(ADDR, SIZE) \ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mips_cache_flush_func), \ - 0, VOIDmode, 2, ADDR, Pmode, \ + LCT_NORMAL, VOIDmode, 2, ADDR, Pmode, \ SIZE, TYPE_MODE (sizetype)) /* This version of _mcount does not pop 2 words from the stack. */ diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 5d080658864..0f42d6bd98c 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -684,7 +684,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) insn = emit_insn (gen_rtx_SET (VOIDmode, reg, orig)); /* Put a REG_EQUAL note on this insn, so that it can be optimized. */ - REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, orig, REG_NOTES (insn)); + add_reg_note (insn, REG_EQUAL, orig); /* During and after reload, we need to generate a REG_LABEL_OPERAND note and update LABEL_NUSES because this is not done automatically. */ @@ -3395,11 +3395,9 @@ store_reg (int reg, HOST_WIDE_INT disp, int base) insn = emit_move_insn (tmpreg, gen_rtx_PLUS (Pmode, tmpreg, basereg)); if (DO_FRAME_NOTES) { - REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - gen_rtx_SET (VOIDmode, tmpreg, - gen_rtx_PLUS (Pmode, basereg, delta)), - REG_NOTES (insn)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, + gen_rtx_SET (VOIDmode, tmpreg, + gen_rtx_PLUS (Pmode, basereg, delta))); RTX_FRAME_RELATED_P (insn) = 1; } dest = gen_rtx_MEM (word_mode, tmpreg); @@ -3415,16 +3413,13 @@ store_reg (int reg, HOST_WIDE_INT disp, int base) dest = gen_rtx_MEM (word_mode, gen_rtx_LO_SUM (Pmode, tmpreg, delta)); insn = emit_move_insn (dest, src); if (DO_FRAME_NOTES) - { - REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - gen_rtx_SET (VOIDmode, - gen_rtx_MEM (word_mode, - gen_rtx_PLUS (word_mode, basereg, - delta)), - src), - REG_NOTES (insn)); - } + add_reg_note (insn, REG_FRAME_RELATED_EXPR, + gen_rtx_SET (VOIDmode, + gen_rtx_MEM (word_mode, + gen_rtx_PLUS (word_mode, + basereg, + delta)), + src)); } if (DO_FRAME_NOTES) @@ -3484,11 +3479,9 @@ set_reg_plus_d (int reg, int base, HOST_WIDE_INT disp, int note) insn = emit_move_insn (gen_rtx_REG (Pmode, reg), gen_rtx_PLUS (Pmode, tmpreg, basereg)); if (DO_FRAME_NOTES) - REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - gen_rtx_SET (VOIDmode, tmpreg, - gen_rtx_PLUS (Pmode, basereg, delta)), - REG_NOTES (insn)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, + gen_rtx_SET (VOIDmode, tmpreg, + gen_rtx_PLUS (Pmode, basereg, delta))); } else { @@ -3912,10 +3905,8 @@ hppa_expand_prologue (void) { rtx mem = gen_rtx_MEM (DFmode, plus_constant (base, offset)); - REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - gen_rtx_SET (VOIDmode, mem, reg), - REG_NOTES (insn)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, + gen_rtx_SET (VOIDmode, mem, reg)); } else { @@ -3932,10 +3923,8 @@ hppa_expand_prologue (void) RTX_FRAME_RELATED_P (setl) = 1; RTX_FRAME_RELATED_P (setr) = 1; vec = gen_rtvec (2, setl, setr); - REG_NOTES (insn) - = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - gen_rtx_SEQUENCE (VOIDmode, vec), - REG_NOTES (insn)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, + gen_rtx_SEQUENCE (VOIDmode, vec)); } } offset += GET_MODE_SIZE (DFmode); @@ -4353,8 +4342,7 @@ hppa_profile_hook (int label_no) /* Indicate the _mcount call cannot throw, nor will it execute a non-local goto. */ - REG_NOTES (call_insn) - = gen_rtx_EXPR_LIST (REG_EH_REGION, constm1_rtx, REG_NOTES (call_insn)); + add_reg_note (call_insn, REG_EH_REGION, constm1_rtx); } /* Fetch the return address for the frame COUNT steps up from diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index 79c96ac5efd..ebcb11116aa 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -1,5 +1,5 @@ /* Subroutines for the C front end on the POWER and PowerPC architectures. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Zack Weinberg <zack@codesourcery.com> @@ -2993,13 +2993,15 @@ altivec_build_resolved_builtin (tree *args, int n, support Altivec's overloaded builtins. */ tree -altivec_resolve_overloaded_builtin (tree fndecl, tree arglist) +altivec_resolve_overloaded_builtin (tree fndecl, void *passed_arglist) { + VEC(tree,gc) *arglist = (VEC(tree,gc) *) passed_arglist; + unsigned int nargs = VEC_length (tree, arglist); unsigned int fcode = DECL_FUNCTION_CODE (fndecl); tree fnargs = TYPE_ARG_TYPES (TREE_TYPE (fndecl)); tree types[3], args[3]; const struct altivec_builtin_types *desc; - int n; + unsigned int n; if (fcode < ALTIVEC_BUILTIN_OVERLOADED_FIRST || fcode > ALTIVEC_BUILTIN_OVERLOADED_LAST) @@ -3016,33 +3018,27 @@ altivec_resolve_overloaded_builtin (tree fndecl, tree arglist) VEC(constructor_elt,gc) *vec; const char *name = fcode == ALTIVEC_BUILTIN_VEC_SPLATS ? "vec_splats": "vec_promote"; - if (!arglist) + if (nargs == 0) { error ("%s only accepts %d arguments", name, (fcode == ALTIVEC_BUILTIN_VEC_PROMOTE)+1 ); return error_mark_node; } - if (fcode == ALTIVEC_BUILTIN_VEC_SPLATS && TREE_CHAIN (arglist)) + if (fcode == ALTIVEC_BUILTIN_VEC_SPLATS && nargs != 1) { error ("%s only accepts 1 argument", name); return error_mark_node; } - if (fcode == ALTIVEC_BUILTIN_VEC_PROMOTE && !TREE_CHAIN (arglist)) + if (fcode == ALTIVEC_BUILTIN_VEC_PROMOTE && nargs != 2) { error ("%s only accepts 2 arguments", name); return error_mark_node; } /* Ignore promote's element argument. */ if (fcode == ALTIVEC_BUILTIN_VEC_PROMOTE - && TREE_CHAIN (TREE_CHAIN (arglist))) - { - error ("%s only accepts 2 arguments", name); - return error_mark_node; - } - if (fcode == ALTIVEC_BUILTIN_VEC_PROMOTE - && !INTEGRAL_TYPE_P (TREE_TYPE (TREE_VALUE (TREE_CHAIN (arglist))))) + && !INTEGRAL_TYPE_P (TREE_TYPE (VEC_index (tree, arglist, 1)))) goto bad; - arg = TREE_VALUE (arglist); + arg = VEC_index (tree, arglist, 0); type = TREE_TYPE (arg); if (!SCALAR_FLOAT_TYPE_P (type) && !INTEGRAL_TYPE_P (type)) @@ -3093,15 +3089,14 @@ altivec_resolve_overloaded_builtin (tree fndecl, tree arglist) tree innerptrtype; /* No second argument. */ - if (!arglist || !TREE_CHAIN (arglist) - || TREE_CHAIN (TREE_CHAIN (arglist))) + if (nargs != 2) { error ("vec_extract only accepts 2 arguments"); return error_mark_node; } - arg2 = TREE_VALUE (TREE_CHAIN (arglist)); - arg1 = TREE_VALUE (arglist); + arg2 = VEC_index (tree, arglist, 1); + arg1 = VEC_index (tree, arglist, 0); arg1_type = TREE_TYPE (arg1); if (TREE_CODE (arg1_type) != VECTOR_TYPE) @@ -3149,18 +3144,16 @@ altivec_resolve_overloaded_builtin (tree fndecl, tree arglist) tree innerptrtype; /* No second or third arguments. */ - if (!arglist || !TREE_CHAIN (arglist) - || !TREE_CHAIN (TREE_CHAIN (arglist)) - || TREE_CHAIN (TREE_CHAIN (TREE_CHAIN (arglist)))) + if (nargs != 3) { error ("vec_insert only accepts 3 arguments"); return error_mark_node; } - arg0 = TREE_VALUE (arglist); - arg1 = TREE_VALUE (TREE_CHAIN (arglist)); + arg0 = VEC_index (tree, arglist, 0); + arg1 = VEC_index (tree, arglist, 1); arg1_type = TREE_TYPE (arg1); - arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); + arg2 = VEC_index (tree, arglist, 2); if (TREE_CODE (arg1_type) != VECTOR_TYPE) goto bad; @@ -3198,11 +3191,11 @@ altivec_resolve_overloaded_builtin (tree fndecl, tree arglist) } for (n = 0; - !VOID_TYPE_P (TREE_VALUE (fnargs)) && arglist; - fnargs = TREE_CHAIN (fnargs), arglist = TREE_CHAIN (arglist), n++) + !VOID_TYPE_P (TREE_VALUE (fnargs)) && n < nargs; + fnargs = TREE_CHAIN (fnargs), n++) { tree decl_type = TREE_VALUE (fnargs); - tree arg = TREE_VALUE (arglist); + tree arg = VEC_index (tree, arglist, n); tree type; if (arg == error_mark_node) @@ -3248,7 +3241,7 @@ altivec_resolve_overloaded_builtin (tree fndecl, tree arglist) /* If the number of arguments did not match the prototype, return NULL and the generic code will issue the appropriate error message. */ - if (!VOID_TYPE_P (TREE_VALUE (fnargs)) || arglist) + if (!VOID_TYPE_P (TREE_VALUE (fnargs)) || nargs > 0) return NULL; if (n == 0) @@ -3281,4 +3274,3 @@ altivec_resolve_overloaded_builtin (tree fndecl, tree arglist) error ("invalid parameter combination for AltiVec intrinsic"); return error_mark_node; } - diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h index 9fa0e345839..c898d51e3a3 100644 --- a/gcc/config/rs6000/rs6000-protos.h +++ b/gcc/config/rs6000/rs6000-protos.h @@ -134,7 +134,7 @@ extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int, int); extern int function_arg_boundary (enum machine_mode, tree); extern rtx function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); -extern tree altivec_resolve_overloaded_builtin (tree, tree); +extern tree altivec_resolve_overloaded_builtin (tree, void *); extern rtx rs6000_function_value (const_tree, const_tree); extern rtx rs6000_libcall_value (enum machine_mode); extern rtx rs6000_va_arg (tree, tree); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 07131b72723..69ef4d209cf 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1346,7 +1346,7 @@ rs6000_init_hard_regno_mode_ok (void) for (r = 0; r < FIRST_PSEUDO_REGISTER; ++r) for (m = 0; m < NUM_MACHINE_MODES; ++m) - if (rs6000_hard_regno_mode_ok (r, m)) + if (rs6000_hard_regno_mode_ok (r, (enum machine_mode) m)) rs6000_hard_regno_mode_ok_p[m][r] = true; } @@ -8560,8 +8560,8 @@ altivec_expand_vec_set_builtin (tree exp) mode1 = TYPE_MODE (TREE_TYPE (TREE_TYPE (arg0))); gcc_assert (VECTOR_MODE_P (tmode)); - op0 = expand_expr (arg0, NULL_RTX, tmode, 0); - op1 = expand_expr (arg1, NULL_RTX, mode1, 0); + op0 = expand_expr (arg0, NULL_RTX, tmode, EXPAND_NORMAL); + op1 = expand_expr (arg1, NULL_RTX, mode1, EXPAND_NORMAL); elt = get_element_number (TREE_TYPE (arg0), arg2); if (GET_MODE (op1) != mode1 && GET_MODE (op1) != VOIDmode) @@ -14035,7 +14035,7 @@ emit_unlikely_jump (rtx cond, rtx label) x = gen_rtx_IF_THEN_ELSE (VOIDmode, cond, label, pc_rtx); x = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, x)); - REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_BR_PROB, very_unlikely, NULL_RTX); + add_reg_note (x, REG_BR_PROB, very_unlikely); } /* A subroutine of the atomic operation splitters. Emit a load-locked @@ -15628,12 +15628,10 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12, int copy_r11) set_mem_alias_set (mem, get_frame_alias_set ()); RTX_FRAME_RELATED_P (insn) = 1; - REG_NOTES (insn) = - gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - gen_rtx_SET (VOIDmode, stack_reg, - gen_rtx_PLUS (Pmode, stack_reg, - GEN_INT (-size))), - REG_NOTES (insn)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, + gen_rtx_SET (VOIDmode, stack_reg, + gen_rtx_PLUS (Pmode, stack_reg, + GEN_INT (-size)))); } /* Add to 'insn' a note which is PATTERN (INSN) but with REG replaced @@ -15714,9 +15712,7 @@ rs6000_frame_related (rtx insn, rtx reg, HOST_WIDE_INT val, } RTX_FRAME_RELATED_P (insn) = 1; - REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - real, - REG_NOTES (insn)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, real); } /* Returns an insn that has a vrsave set operation with the @@ -16341,9 +16337,7 @@ rs6000_emit_prologue (void) We use CR2_REGNO (70) to be compatible with gcc-2.95 on Linux. */ set = gen_rtx_SET (VOIDmode, cr_save_rtx, gen_rtx_REG (SImode, CR2_REGNO)); - REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - set, - REG_NOTES (insn)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, set); } /* Do any required saving of fpr's. If only one or two to save, do @@ -16599,10 +16593,7 @@ rs6000_emit_prologue (void) insn = emit_insn (gen_movesi_from_cr (cr_save_rtx)); RTX_FRAME_RELATED_P (insn) = 1; set = gen_rtx_SET (VOIDmode, cr_save_rtx, magic_eh_cr_reg); - REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - set, - REG_NOTES (insn)); - + add_reg_note (insn, REG_FRAME_RELATED_EXPR, set); } insn = emit_move_insn (mem, cr_save_rtx); @@ -18132,7 +18123,7 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode) h->key_mode = mode; h->labelno = labelno; - found = htab_find_slot (toc_hash_table, h, 1); + found = htab_find_slot (toc_hash_table, h, INSERT); if (*found == NULL) *found = h; else /* This is indeed a duplicate. @@ -18553,7 +18544,8 @@ output_profile_hook (int labelno ATTRIBUTE_UNUSED) # define NO_PROFILE_COUNTERS 0 #endif if (NO_PROFILE_COUNTERS) - emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 0); + emit_library_call (init_one_libfunc (RS6000_MCOUNT), + LCT_NORMAL, VOIDmode, 0); else { char buf[30]; @@ -18564,8 +18556,8 @@ output_profile_hook (int labelno ATTRIBUTE_UNUSED) label_name = (*targetm.strip_name_encoding) (ggc_strdup (buf)); fun = gen_rtx_SYMBOL_REF (Pmode, label_name); - emit_library_call (init_one_libfunc (RS6000_MCOUNT), 0, VOIDmode, 1, - fun, Pmode); + emit_library_call (init_one_libfunc (RS6000_MCOUNT), + LCT_NORMAL, VOIDmode, 1, fun, Pmode); } } else if (DEFAULT_ABI == ABI_DARWIN) @@ -18584,7 +18576,7 @@ output_profile_hook (int labelno ATTRIBUTE_UNUSED) caller_addr_regno = 0; #endif emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mcount_name), - 0, VOIDmode, 1, + LCT_NORMAL, VOIDmode, 1, gen_rtx_REG (Pmode, caller_addr_regno), Pmode); } } @@ -20487,7 +20479,7 @@ rs6000_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt) case ABI_DARWIN: case ABI_V4: emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__trampoline_setup"), - FALSE, VOIDmode, 4, + LCT_NORMAL, VOIDmode, 4, addr, Pmode, GEN_INT (rs6000_trampoline_size ()), SImode, fnaddr, Pmode, @@ -22730,7 +22722,7 @@ rs6000_init_dwarf_reg_sizes_extra (tree address) { int i; enum machine_mode mode = TYPE_MODE (char_type_node); - rtx addr = expand_expr (address, NULL_RTX, VOIDmode, 0); + rtx addr = expand_expr (address, NULL_RTX, VOIDmode, EXPAND_NORMAL); rtx mem = gen_rtx_MEM (BLKmode, addr); rtx value = gen_int_mode (4, mode); diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 1cf9f8eb270..5c1f1b17f2b 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -1,6 +1,6 @@ /* Subroutines used for code generation on IBM S/390 and zSeries Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008 Free Software Foundation, Inc. + 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Hartmut Penner (hpenner@de.ibm.com) and Ulrich Weigand (uweigand@de.ibm.com) and Andreas Krebbel (Andreas.Krebbel@de.ibm.com). @@ -2320,9 +2320,9 @@ s390_rtx_costs (rtx x, int code, int outer_code, int *total, *total = s390_cost->madbr; else *total = s390_cost->maebr; - *total += rtx_cost (XEXP (XEXP (x, 0), 0), MULT, speed) - + rtx_cost (XEXP (XEXP (x, 0), 1), MULT, speed) - + rtx_cost (XEXP (x, 1), code, speed); + *total += (rtx_cost (XEXP (XEXP (x, 0), 0), MULT, speed) + + rtx_cost (XEXP (XEXP (x, 0), 1), MULT, speed) + + rtx_cost (XEXP (x, 1), (enum rtx_code) code, speed)); return true; /* Do not do an additional recursive descent. */ } *total = COSTS_N_INSNS (1); @@ -3909,11 +3909,13 @@ s390_expand_movmem (rtx dst, rtx src, rtx len) dst = change_address (dst, VOIDmode, dst_addr); src = change_address (src, VOIDmode, src_addr); - temp = expand_binop (mode, add_optab, count, constm1_rtx, count, 1, 0); + temp = expand_binop (mode, add_optab, count, constm1_rtx, count, 1, + OPTAB_DIRECT); if (temp != count) emit_move_insn (count, temp); - temp = expand_binop (mode, lshr_optab, count, GEN_INT (8), blocks, 1, 0); + temp = expand_binop (mode, lshr_optab, count, GEN_INT (8), blocks, 1, + OPTAB_DIRECT); if (temp != blocks) emit_move_insn (blocks, temp); @@ -3928,7 +3930,8 @@ s390_expand_movmem (rtx dst, rtx src, rtx len) s390_load_address (src_addr, gen_rtx_PLUS (Pmode, src_addr, GEN_INT (256))); - temp = expand_binop (mode, add_optab, blocks, constm1_rtx, blocks, 1, 0); + temp = expand_binop (mode, add_optab, blocks, constm1_rtx, blocks, 1, + OPTAB_DIRECT); if (temp != blocks) emit_move_insn (blocks, temp); @@ -4011,7 +4014,8 @@ s390_expand_setmem (rtx dst, rtx len, rtx val) dst = change_address (dst, VOIDmode, dst_addr); if (val == const0_rtx) - temp = expand_binop (mode, add_optab, count, constm1_rtx, count, 1, 0); + temp = expand_binop (mode, add_optab, count, constm1_rtx, count, 1, + OPTAB_DIRECT); else { dstp1 = adjust_address (dst, VOIDmode, 1); @@ -4024,12 +4028,14 @@ s390_expand_setmem (rtx dst, rtx len, rtx val) emit_cmp_and_jump_insns (count, const1_rtx, EQ, NULL_RTX, mode, 1, end_label); - temp = expand_binop (mode, add_optab, count, GEN_INT (-2), count, 1, 0); + temp = expand_binop (mode, add_optab, count, GEN_INT (-2), count, 1, + OPTAB_DIRECT); } if (temp != count) emit_move_insn (count, temp); - temp = expand_binop (mode, lshr_optab, count, GEN_INT (8), blocks, 1, 0); + temp = expand_binop (mode, lshr_optab, count, GEN_INT (8), blocks, 1, + OPTAB_DIRECT); if (temp != blocks) emit_move_insn (blocks, temp); @@ -4045,7 +4051,8 @@ s390_expand_setmem (rtx dst, rtx len, rtx val) s390_load_address (dst_addr, gen_rtx_PLUS (Pmode, dst_addr, GEN_INT (256))); - temp = expand_binop (mode, add_optab, blocks, constm1_rtx, blocks, 1, 0); + temp = expand_binop (mode, add_optab, blocks, constm1_rtx, blocks, 1, + OPTAB_DIRECT); if (temp != blocks) emit_move_insn (blocks, temp); @@ -4117,11 +4124,13 @@ s390_expand_cmpmem (rtx target, rtx op0, rtx op1, rtx len) op0 = change_address (op0, VOIDmode, addr0); op1 = change_address (op1, VOIDmode, addr1); - temp = expand_binop (mode, add_optab, count, constm1_rtx, count, 1, 0); + temp = expand_binop (mode, add_optab, count, constm1_rtx, count, 1, + OPTAB_DIRECT); if (temp != count) emit_move_insn (count, temp); - temp = expand_binop (mode, lshr_optab, count, GEN_INT (8), blocks, 1, 0); + temp = expand_binop (mode, lshr_optab, count, GEN_INT (8), blocks, 1, + OPTAB_DIRECT); if (temp != blocks) emit_move_insn (blocks, temp); @@ -4142,7 +4151,8 @@ s390_expand_cmpmem (rtx target, rtx op0, rtx op1, rtx len) s390_load_address (addr1, gen_rtx_PLUS (Pmode, addr1, GEN_INT (256))); - temp = expand_binop (mode, add_optab, blocks, constm1_rtx, blocks, 1, 0); + temp = expand_binop (mode, add_optab, blocks, constm1_rtx, blocks, 1, + OPTAB_DIRECT); if (temp != blocks) emit_move_insn (blocks, temp); @@ -7490,9 +7500,7 @@ save_gprs (rtx base, int offset, int first, int last) GEN_INT (last - 6 + 1)); note = PATTERN (note); - REG_NOTES (insn) = - gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - note, REG_NOTES (insn)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, note); for (i = 0; i < XVECLEN (note, 0); i++) if (GET_CODE (XVECEXP (note, 0, i)) == SET) @@ -7704,6 +7712,7 @@ s390_emit_prologue (void) if (cfun_frame_layout.frame_size > 0) { rtx frame_off = GEN_INT (-cfun_frame_layout.frame_size); + rtx real_frame_off; if (s390_stack_size) { @@ -7781,12 +7790,11 @@ s390_emit_prologue (void) } RTX_FRAME_RELATED_P (insn) = 1; - REG_NOTES (insn) = - gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - gen_rtx_SET (VOIDmode, stack_pointer_rtx, - gen_rtx_PLUS (Pmode, stack_pointer_rtx, - GEN_INT (-cfun_frame_layout.frame_size))), - REG_NOTES (insn)); + real_frame_off = GEN_INT (-cfun_frame_layout.frame_size); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, + gen_rtx_SET (VOIDmode, stack_pointer_rtx, + gen_rtx_PLUS (Pmode, stack_pointer_rtx, + real_frame_off))); /* Set backchain. */ @@ -7838,12 +7846,10 @@ s390_emit_prologue (void) insn = save_fpr (temp_reg, offset, i); offset += 8; RTX_FRAME_RELATED_P (insn) = 1; - REG_NOTES (insn) = - gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - gen_rtx_SET (VOIDmode, - gen_rtx_MEM (DFmode, addr), - gen_rtx_REG (DFmode, i)), - REG_NOTES (insn)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, + gen_rtx_SET (VOIDmode, + gen_rtx_MEM (DFmode, addr), + gen_rtx_REG (DFmode, i))); } } @@ -8725,7 +8731,7 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, insn_op = &insn_data[icode].operand[arity + nonvoid]; - op[arity] = expand_expr (arg, NULL_RTX, insn_op->mode, 0); + op[arity] = expand_expr (arg, NULL_RTX, insn_op->mode, EXPAND_NORMAL); if (!(*insn_op->predicate) (op[arity], insn_op->mode)) op[arity] = copy_to_mode_reg (insn_op->mode, op[arity]); diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 7e6a358f89b..62d025f4ceb 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -1,6 +1,6 @@ /* Subroutines for insn-output.c for SPARC. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) 64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans, @@ -4082,10 +4082,8 @@ sparc_expand_prologue (void) rtx reg = gen_rtx_REG (Pmode, 1); emit_move_insn (reg, GEN_INT (-actual_fsize)); insn = emit_insn (gen_stack_pointer_inc (reg)); - REG_NOTES (insn) = - gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - gen_stack_pointer_inc (GEN_INT (-actual_fsize)), - REG_NOTES (insn)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, + gen_stack_pointer_inc (GEN_INT (-actual_fsize))); } RTX_FRAME_RELATED_P (insn) = 1; @@ -8255,13 +8253,14 @@ sparc_fold_builtin (tree fndecl, tree arglist, bool ignore) { tree arg0, arg1, arg2; tree rtype = TREE_TYPE (TREE_TYPE (fndecl)); + enum insn_code icode = (enum insn_code) DECL_FUNCTION_CODE (fndecl); if (ignore - && DECL_FUNCTION_CODE (fndecl) != CODE_FOR_alignaddrsi_vis - && DECL_FUNCTION_CODE (fndecl) != CODE_FOR_alignaddrdi_vis) + && icode != CODE_FOR_alignaddrsi_vis + && icode != CODE_FOR_alignaddrdi_vis) return fold_convert (rtype, integer_zero_node); - switch (DECL_FUNCTION_CODE (fndecl)) + switch (icode) { case CODE_FOR_fexpand_vis: arg0 = TREE_VALUE (arglist); @@ -8297,8 +8296,8 @@ sparc_fold_builtin (tree fndecl, tree arglist, bool ignore) tree inner_type = TREE_TYPE (rtype); tree elts0 = TREE_VECTOR_CST_ELTS (arg0); tree elts1 = TREE_VECTOR_CST_ELTS (arg1); - tree n_elts = sparc_handle_vis_mul8x16 (DECL_FUNCTION_CODE (fndecl), - inner_type, elts0, elts1); + tree n_elts = sparc_handle_vis_mul8x16 (icode, inner_type, elts0, + elts1); return build_vector (rtype, n_elts); } diff --git a/gcc/config/spu/spu-c.c b/gcc/config/spu/spu-c.c index 7db0bfb83ad..2ae57ba44c0 100644 --- a/gcc/config/spu/spu-c.c +++ b/gcc/config/spu/spu-c.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -96,11 +96,13 @@ spu_macro_to_expand (cpp_reader *pfile, const cpp_token *tok) /* target hook for resolve_overloaded_builtin(). Returns a function call RTX if we can resolve the overloaded builtin */ tree -spu_resolve_overloaded_builtin (tree fndecl, tree fnargs) +spu_resolve_overloaded_builtin (tree fndecl, void *passed_args) { #define SCALAR_TYPE_P(t) (INTEGRAL_TYPE_P (t) \ || SCALAR_FLOAT_TYPE_P (t) \ || POINTER_TYPE_P (t)) + VEC(tree,gc) *fnargs = (VEC(tree,gc) *) passed_args; + unsigned int nargs = VEC_length (tree, fnargs); spu_function_code new_fcode, fcode = DECL_FUNCTION_CODE (fndecl) - END_BUILTINS; struct spu_builtin_description *desc; @@ -121,23 +123,23 @@ spu_resolve_overloaded_builtin (tree fndecl, tree fnargs) { tree decl = spu_builtins[new_fcode].fndecl; tree params = TYPE_ARG_TYPES (TREE_TYPE (decl)); - tree arg, param; - int p; + tree param; + unsigned int p; - for (param = params, arg = fnargs, p = 0; + for (param = params, p = 0; param != void_list_node; - param = TREE_CHAIN (param), arg = TREE_CHAIN (arg), p++) + param = TREE_CHAIN (param), p++) { tree var, arg_type, param_type = TREE_VALUE (param); - if (!arg) + if (p < nargs) { error ("insufficient arguments to overloaded function %s", desc->name); return error_mark_node; } - var = TREE_VALUE (arg); + var = VEC_index (tree, fnargs, p); if (TREE_CODE (var) == NON_LVALUE_EXPR) var = TREE_OPERAND (var, 0); @@ -165,7 +167,7 @@ spu_resolve_overloaded_builtin (tree fndecl, tree fnargs) } if (param == void_list_node) { - if (arg) + if (p != nargs) { error ("too many arguments to overloaded function %s", desc->name); @@ -184,7 +186,7 @@ spu_resolve_overloaded_builtin (tree fndecl, tree fnargs) return error_mark_node; } - return build_function_call (match, fnargs); + return build_function_call_vec (match, fnargs, NULL); #undef SCALAR_TYPE_P } diff --git a/gcc/config/spu/spu-protos.h b/gcc/config/spu/spu-protos.h index 48ec9697237..07eb654c7f3 100644 --- a/gcc/config/spu/spu-protos.h +++ b/gcc/config/spu/spu-protos.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -90,7 +90,7 @@ extern void spu_expand_vector_init (rtx target, rtx vals); extern void spu_init_expanders (void); /* spu-c.c */ -extern tree spu_resolve_overloaded_builtin (tree fndecl, tree fnargs); +extern tree spu_resolve_overloaded_builtin (tree fndecl, void *fnargs); extern rtx spu_expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, int ignore); extern rtx spu_expand_builtin (tree, rtx, rtx, enum machine_mode, int); diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c index 8e165713df3..b0ba7ceebd2 100644 --- a/gcc/config/spu/spu.c +++ b/gcc/config/spu/spu.c @@ -786,7 +786,8 @@ spu_emit_branch_or_set (int is_set, enum rtx_code code, rtx operands[]) rtx target = operands[0]; enum machine_mode comp_mode; enum machine_mode op_mode; - enum spu_comp_code scode, eq_code, ior_code; + enum spu_comp_code scode, eq_code; + enum insn_code ior_code; int index; int eq_test = 0; @@ -1886,8 +1887,7 @@ spu_expand_prologue (void) } RTX_FRAME_RELATED_P (insn) = 1; real = gen_addsi3 (sp_reg, sp_reg, GEN_INT (-total_size)); - REG_NOTES (insn) = - gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, real, REG_NOTES (insn)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, real); if (total_size > 2000) { @@ -1904,9 +1904,7 @@ spu_expand_prologue (void) insn = frame_emit_add_imm (fp_reg, sp_reg, fp_offset, scratch_reg_0); RTX_FRAME_RELATED_P (insn) = 1; real = gen_addsi3 (fp_reg, sp_reg, GEN_INT (fp_offset)); - REG_NOTES (insn) = - gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, - real, REG_NOTES (insn)); + add_reg_note (insn, REG_FRAME_RELATED_EXPR, real); REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM) = STACK_BOUNDARY; } } @@ -5892,7 +5890,7 @@ expand_builtin_args (struct spu_builtin_description *d, tree exp, tree arg = CALL_EXPR_ARG (exp, a); if (arg == 0) abort (); - ops[i] = expand_expr (arg, NULL_RTX, VOIDmode, 0); + ops[i] = expand_expr (arg, NULL_RTX, VOIDmode, EXPAND_NORMAL); } /* The insn pattern may have additional operands (SCRATCH). @@ -6291,4 +6289,3 @@ spu_section_type_flags (tree decl, const char *name, int reloc) return SECTION_BSS; return default_section_type_flags (decl, name, reloc); } - |