diff options
author | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-06-16 13:45:47 +0000 |
---|---|---|
committer | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-06-16 13:45:47 +0000 |
commit | 39cba15779c8b976cccfa6a358622e4024ab7deb (patch) | |
tree | 6743d4344d7e67eee9f7e260f9fb67f3449e8691 /gcc/config/iq2000/iq2000.c | |
parent | 0187b74ef9bfdac284a5dd4ee9bff6381c819549 (diff) | |
download | gcc-39cba15779c8b976cccfa6a358622e4024ab7deb.tar.gz |
PR middle-end/46500
gcc:
* doc/tm.texi.in: Update Copyright date.
* doc/tm.texi: Regenerate.
* targhooks.c (default_setup_incoming_varargs): Replace
CUMULATIVE_ARGS* argument type with cumulative_args_t.
(default_pretend_outgoing_varargs_named): Likewise.
(hook_pass_by_reference_must_pass_in_stack): Likewise.
(hook_callee_copies_named): Likewise.
(default_function_arg_advance): Likewise.
(default_function_arg): Likewise.
(default_function_incoming_arg): Likewise.
(hook_bool_CUMULATIVE_ARGS_false): Likewise.
(hook_bool_CUMULATIVE_ARGS_true): Likewise.
(hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise.
(hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise.
(hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise.
* targhooks.h (default_setup_incoming_varargs): Likewise.
(default_pretend_outgoing_varargs_named): Likewise.
(hook_pass_by_reference_must_pass_in_stack): Likewise.
(hook_callee_copies_named): Likewise.
(default_function_arg_advance): Likewise.
(default_function_arg): Likewise.
(default_function_incoming_arg): Likewise.
(hook_bool_CUMULATIVE_ARGS_false): Likewise.
(hook_bool_CUMULATIVE_ARGS_true): Likewise.
(hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise.
(hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise.
(hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise.
* target.def (pass_by_reference): Likewise.
(setup_incoming_varargs, strict_argument_naming): Likewise.
(pretend_outgoing_varargs_named, callee_copies): Likewise.
(arg_partial_bytes, function_arg_advance, function_arg): Likewise.
(function_incoming_arg): Likewise.
* target.h: Don't include "tm.h" .
(cumulative_args_t): New typedef.
[GCC_TM_H] (get_cumulative_args): New static inline function.
[GCC_TM_H] (pack_cumulative_args): Likewise.
* config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS*
argument type with cumulative_args_t.
(alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise.
(alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise.
* config/frv/frv.c (frv_setup_incoming_varargs): Likewise.
(frv_arg_partial_bytes, frv_function_arg): Likewise.
(frv_function_incoming_arg, frv_function_arg_advance): Likewise.
(frv_function_arg_1): Likewise.
* config/s390/s390.c (s390_pass_by_reference): Likewise.
(s390_function_arg_advance, s390_function_arg): Likewise.
* config/m32c/m32c.c (m32c_function_arg): Likewise.
(m32c_pass_by_reference, m32c_function_arg_advance): Likewise.
(m32c_strict_argument_naming): Likewise.
* config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise.
(spu_function_arg_advance): Likewise.
(spu_setup_incoming_varargs): Likewise. Make static.
* config/spu/spu-protos.h (spu_setup_incoming_varargs):
Remove prototype.
* config/sparc/sparc.c (sparc_strict_argument_naming): Replace
CUMULATIVE_ARGS* argument type with cumulative_args_t.
(sparc_pass_by_reference, sparc_function_arg_advance): Likewise.
(sparc_function_arg, sparc_function_incoming_arg): Likewise.
(sparc_arg_partial_bytes, sparc_function_arg_1): Likewise.
* config/mep/mep.c (mep_setup_incoming_varargs): Likewise.
(mep_pass_by_reference, mep_function_arg): Likewise.
(mep_function_arg_advance): Likewise.
* config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise.
(m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise.
(m32r_function_arg, m32r_function_arg_advance): Likewise.
* config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise.
* config/i386/i386.c (ix86_function_arg_advance): Likewise.
(ix86_function_arg, ix86_pass_by_reference): Likewise.
(ix86_setup_incoming_varargs): Likewise.
* config/sh/sh.c (sh_setup_incoming_varargs): Likewise.
(sh_strict_argument_naming): Likewise.
(sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise.
(sh_callee_copies, sh_arg_partial_bytes): Likewise.
(sh_function_arg_advance, sh_function_arg): Likewise.
* config/pdp11/pdp11.c (pdp11_function_arg): Likewise.
(pdp11_function_arg_advance): Likewise.
* config/microblaze/microblaze.c (microblaze_function_arg_advance):
Likewise.
(microblaze_function_arg, function_arg_partial_bytes): Likewise.
* config/avr/avr.c (avr_function_arg): Likewise.
(avr_function_arg_advance): Likewise.
* config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise.
(xtensa_function_arg, xtensa_function_incoming_arg): Likewise.
(xtensa_function_arg_1): Likewise.
* config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise.
(xstormy16_function_arg): Likewise.
* config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise.
(fr30_arg_partial_bytes, fr30_function_arg): Likewise.
(fr30_function_arg_advance): Likewise.
* config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise.
(lm32_function_arg, lm32_function_arg_advance): Likewise.
* config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise.
(moxie_function_arg, moxie_function_arg_advance): Likewise.
(moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise.
* config/cris/cris.c (cris_setup_incoming_varargs): Likewise.
(cris_pass_by_reference, cris_arg_partial_bytes): Likewise.
(cris_function_arg, cris_function_incoming_arg): Likewise.
(cris_function_arg_advance, cris_function_arg_1): Likewise.
* config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise.
(iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise.
(iq2000_function_arg, iq2000_function_arg_advance): Likewise.
* config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise.
(mn10300_function_arg, mn10300_function_arg_advance): Likewise.
(mn10300_arg_partial_bytes): Likewise.
* config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise.
(ia64_arg_partial_bytes, ia64_function_arg): Likewise.
(ia64_function_incoming_arg, ia64_function_arg_advance): Likewise.
(ia64_function_arg_1): Likewise.
* config/m68k/m68k.c (m68k_function_arg_advance): Likewise.
(m68k_function_arg): Likewise.
* config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise.
(rs6000_function_arg, setup_incoming_varargs): Likewise.
(rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise.
* config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise.
(picochip_function_arg, picochip_incoming_function_arg): Likewise.
(picochip_arg_advance): Likewise.
* config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise.
(mcore_arg_partial_bytes, mcore_function_arg): Likewise.
(mcore_function_arg_advance): Likewise.
* config/score/score.c (score_pass_by_reference): Likewise.
(score_function_arg_advance): Likewise.
(score_arg_partial_bytes): Likewise. Make static.
* config/score/score-protos.h (score_arg_partial_bytes): Don't declare.
* config/arm/arm.c (arm_arg_partial_bytes): Replace
CUMULATIVE_ARGS* argument type with cumulative_args_t.
(arm_function_arg, arm_function_arg_advance): Likewise.
(arm_setup_incoming_varargs, arm_pass_by_reference): Likewise.
* config/pa/pa.c (pa_pass_by_reference): Likewise.
(pa_arg_partial_bytes, pa_function_arg_advance): Likewise.
(pa_function_arg): Likewise.
* config/mips/mips.c (mips_strict_argument_naming): Likewise.
(mips_function_arg, mips_function_arg_advance): Likewise.
(mips_arg_partial_bytes, mips_pass_by_reference): Likewise.
(mips_callee_copies, mips_setup_incoming_varargs): Likewise.
* config/vax/vax.c (vax_function_arg): Likewise.
(vax_function_arg_advance): Likewise.
* config/h8300/h8300.c (h8300_function_arg): Likewise.
(h8300_function_arg_advance): Likewise.
* config/v850/v850.c (v850_pass_by_reference): Likewise.
(v850_strict_argument_naming, v850_function_arg): Likewise.
(v850_arg_partial_bytes, v850_function_arg_advance): Likewise.
(v850_setup_incoming_varargs): Likewise.
* config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise.
(mmix_function_arg_advance, mmix_function_incoming_arg): Likewise.
(mmix_function_arg, mmix_pass_by_reference): Likewise.
(mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type
with const void *.
* config/bfin/bfin.c (setup_incoming_varargs): Replace
CUMULATIVE_ARGS* argument type with cumulative_args_t.
(bfin_function_arg_advance, bfin_function_arg): Likewise.
(bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise.
* calls.c (emit_call_1): Change type of args_so_far to
cumulative_args_t. Changed all callers.
(initialize_argument_information): Likewise.
(expand_call, emit_library_call_value_1): Use pack_cumulative_args.
* dse.c (get_call_args): Likewise.
* expr.c (block_move_libcall_safe_for_call_parm): Likewise.
* function.c (pass_by_reference, reference_callee_copied): Likewise.
(struct assign_parm_data_all): Rename args_so_far to args_so_far_v.
New member args_so_far_v. Changed all users.
* var-tracking.c (prepare_call_arguments): Use pack_cumulative_args.
* config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise.
* config/mips/mips.c (mips_output_args_xfer): Likewise.
* config/s390/s390.c (s390_call_saved_register_used): Likewise.
* config/sh/sh.c (sh_output_mi_thunk): Likewise.
* config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise.
* config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed
m32r_pass_by_reference.
gcc/ada:
* gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175103 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/iq2000/iq2000.c')
-rw-r--r-- | gcc/config/iq2000/iq2000.c | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index 7512df8564e..916acf28408 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -148,20 +148,20 @@ static section *iq2000_select_rtx_section (enum machine_mode, rtx, static void iq2000_init_builtins (void); static rtx iq2000_expand_builtin (tree, rtx, rtx, enum machine_mode, int); static bool iq2000_return_in_memory (const_tree, const_tree); -static void iq2000_setup_incoming_varargs (CUMULATIVE_ARGS *, +static void iq2000_setup_incoming_varargs (cumulative_args_t, enum machine_mode, tree, int *, int); static bool iq2000_rtx_costs (rtx, int, int, int *, bool); static int iq2000_address_cost (rtx, bool); static section *iq2000_select_section (tree, int, unsigned HOST_WIDE_INT); static rtx iq2000_legitimize_address (rtx, rtx, enum machine_mode); -static bool iq2000_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, +static bool iq2000_pass_by_reference (cumulative_args_t, enum machine_mode, const_tree, bool); -static int iq2000_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, +static int iq2000_arg_partial_bytes (cumulative_args_t, enum machine_mode, tree, bool); -static rtx iq2000_function_arg (CUMULATIVE_ARGS *, +static rtx iq2000_function_arg (cumulative_args_t, enum machine_mode, const_tree, bool); -static void iq2000_function_arg_advance (CUMULATIVE_ARGS *, +static void iq2000_function_arg_advance (cumulative_args_t, enum machine_mode, const_tree, bool); static unsigned int iq2000_function_arg_boundary (enum machine_mode, const_tree); @@ -1129,9 +1129,11 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, position in CUM. */ static void -iq2000_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, +iq2000_function_arg_advance (cumulative_args_t cum_v, enum machine_mode mode, const_tree type, bool named) { + CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); + if (TARGET_DEBUG_D_MODE) { fprintf (stderr, @@ -1198,9 +1200,10 @@ iq2000_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, and type TYPE in CUM, or 0 if the argument is to be passed on the stack. */ static rtx -iq2000_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, +iq2000_function_arg (cumulative_args_t cum_v, enum machine_mode mode, const_tree type, bool named) { + CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); rtx ret; int regbase = -1; int bias = 0; @@ -1374,10 +1377,12 @@ iq2000_function_arg_boundary (enum machine_mode mode, const_tree type) } static int -iq2000_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, +iq2000_arg_partial_bytes (cumulative_args_t cum_v, enum machine_mode mode, tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED) { + CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); + if (mode == DImode && cum->arg_words == MAX_ARGS_IN_REGISTERS - 1) { if (TARGET_DEBUG_D_MODE) @@ -1879,7 +1884,8 @@ iq2000_expand_prologue (void) int i; tree next_arg; tree cur_arg; - CUMULATIVE_ARGS args_so_far; + CUMULATIVE_ARGS args_so_far_v; + cumulative_args_t args_so_far; int store_args_on_stack = (iq2000_can_use_return_insn ()); /* If struct value address is treated as the first argument. */ @@ -1903,7 +1909,8 @@ iq2000_expand_prologue (void) variable arguments. This is only needed if store_args_on_stack is true. */ - INIT_CUMULATIVE_ARGS (args_so_far, fntype, NULL_RTX, 0, 0); + INIT_CUMULATIVE_ARGS (args_so_far_v, fntype, NULL_RTX, 0, 0); + args_so_far = pack_cumulative_args (&args_so_far_v); regno = GP_ARG_FIRST; for (cur_arg = fnargs; cur_arg != 0; cur_arg = next_arg) @@ -1918,10 +1925,10 @@ iq2000_expand_prologue (void) passed_mode = Pmode; } - entry_parm = iq2000_function_arg (&args_so_far, passed_mode, + entry_parm = iq2000_function_arg (args_so_far, passed_mode, passed_type, true); - iq2000_function_arg_advance (&args_so_far, passed_mode, + iq2000_function_arg_advance (args_so_far, passed_mode, passed_type, true); next_arg = DECL_CHAIN (cur_arg); @@ -1964,7 +1971,7 @@ iq2000_expand_prologue (void) iq2000_unction_arg has encoded a PARALLEL rtx, holding a vector of adjustments to be made as the next_arg_reg variable, so we split up the insns, and emit them separately. */ - next_arg_reg = iq2000_function_arg (&args_so_far, VOIDmode, + next_arg_reg = iq2000_function_arg (args_so_far, VOIDmode, void_type_node, true); if (next_arg_reg != 0 && GET_CODE (next_arg_reg) == PARALLEL) { @@ -2238,9 +2245,10 @@ iq2000_function_value_regno_p (const unsigned int regno) /* Return true when an argument must be passed by reference. */ static bool -iq2000_pass_by_reference (CUMULATIVE_ARGS *cum, enum machine_mode mode, +iq2000_pass_by_reference (cumulative_args_t cum_v, enum machine_mode mode, const_tree type, bool named ATTRIBUTE_UNUSED) { + CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); int size; /* We must pass by reference if we would be both passing in registers @@ -2254,7 +2262,8 @@ iq2000_pass_by_reference (CUMULATIVE_ARGS *cum, enum machine_mode mode, CUMULATIVE_ARGS temp; temp = *cum; - if (iq2000_function_arg (&temp, mode, type, named) != 0) + if (iq2000_function_arg (pack_cumulative_args (&temp), mode, type, named) + != 0) return 1; } @@ -2835,11 +2844,12 @@ iq2000_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED) /* Worker function for TARGET_SETUP_INCOMING_VARARGS. */ static void -iq2000_setup_incoming_varargs (CUMULATIVE_ARGS *cum, +iq2000_setup_incoming_varargs (cumulative_args_t cum_v, enum machine_mode mode ATTRIBUTE_UNUSED, tree type ATTRIBUTE_UNUSED, int * pretend_size, int no_rtl) { + CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); unsigned int iq2000_off = ! cum->last_arg_fp; unsigned int iq2000_fp_off = cum->last_arg_fp; |