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/function.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/function.c')
-rw-r--r-- | gcc/function.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/gcc/function.c b/gcc/function.c index 81c4d39de47..5be018afde7 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -2128,7 +2128,8 @@ pass_by_reference (CUMULATIVE_ARGS *ca, enum machine_mode mode, } } - return targetm.calls.pass_by_reference (ca, mode, type, named_arg); + return targetm.calls.pass_by_reference (pack_cumulative_args (ca), mode, + type, named_arg); } /* Return true if TYPE, which is passed by reference, should be callee @@ -2140,7 +2141,8 @@ reference_callee_copied (CUMULATIVE_ARGS *ca, enum machine_mode mode, { if (type && TREE_ADDRESSABLE (type)) return false; - return targetm.calls.callee_copies (ca, mode, type, named_arg); + return targetm.calls.callee_copies (pack_cumulative_args (ca), mode, type, + named_arg); } /* Structures to communicate between the subroutines of assign_parms. @@ -2149,7 +2151,10 @@ reference_callee_copied (CUMULATIVE_ARGS *ca, enum machine_mode mode, struct assign_parm_data_all { - CUMULATIVE_ARGS args_so_far; + /* When INIT_CUMULATIVE_ARGS gets revamped, allocating CUMULATIVE_ARGS + should become a job of the target or otherwise encapsulated. */ + CUMULATIVE_ARGS args_so_far_v; + cumulative_args_t args_so_far; struct args_size stack_args_size; tree function_result_decl; tree orig_fnargs; @@ -2189,11 +2194,12 @@ assign_parms_initialize_all (struct assign_parm_data_all *all) fntype = TREE_TYPE (current_function_decl); #ifdef INIT_CUMULATIVE_INCOMING_ARGS - INIT_CUMULATIVE_INCOMING_ARGS (all->args_so_far, fntype, NULL_RTX); + INIT_CUMULATIVE_INCOMING_ARGS (all->args_so_far_v, fntype, NULL_RTX); #else - INIT_CUMULATIVE_ARGS (all->args_so_far, fntype, NULL_RTX, + INIT_CUMULATIVE_ARGS (all->args_so_far_v, fntype, NULL_RTX, current_function_decl, -1); #endif + all->args_so_far = pack_cumulative_args (&all->args_so_far_v); #ifdef REG_PARM_STACK_SPACE all->reg_parm_stack_space = REG_PARM_STACK_SPACE (current_function_decl); @@ -2314,7 +2320,7 @@ assign_parm_find_data_types (struct assign_parm_data_all *all, tree parm, data->named_arg = 1; /* No variadic parms. */ else if (DECL_CHAIN (parm)) data->named_arg = 1; /* Not the last non-variadic parm. */ - else if (targetm.calls.strict_argument_naming (&all->args_so_far)) + else if (targetm.calls.strict_argument_naming (all->args_so_far)) data->named_arg = 1; /* Only variadic ones are unnamed. */ else data->named_arg = 0; /* Treat as variadic. */ @@ -2350,7 +2356,7 @@ assign_parm_find_data_types (struct assign_parm_data_all *all, tree parm, passed_type = TREE_TYPE (first_field (passed_type)); /* See if this arg was passed by invisible reference. */ - if (pass_by_reference (&all->args_so_far, passed_mode, + if (pass_by_reference (&all->args_so_far_v, passed_mode, passed_type, data->named_arg)) { passed_type = nominal_type = build_pointer_type (passed_type); @@ -2379,7 +2385,7 @@ assign_parms_setup_varargs (struct assign_parm_data_all *all, { int varargs_pretend_bytes = 0; - targetm.calls.setup_incoming_varargs (&all->args_so_far, + targetm.calls.setup_incoming_varargs (all->args_so_far, data->promoted_mode, data->passed_type, &varargs_pretend_bytes, no_rtl); @@ -2408,7 +2414,7 @@ assign_parm_find_entry_rtl (struct assign_parm_data_all *all, return; } - entry_parm = targetm.calls.function_incoming_arg (&all->args_so_far, + entry_parm = targetm.calls.function_incoming_arg (all->args_so_far, data->promoted_mode, data->passed_type, data->named_arg); @@ -2432,10 +2438,10 @@ assign_parm_find_entry_rtl (struct assign_parm_data_all *all, #endif if (!in_regs && !data->named_arg) { - if (targetm.calls.pretend_outgoing_varargs_named (&all->args_so_far)) + if (targetm.calls.pretend_outgoing_varargs_named (all->args_so_far)) { rtx tem; - tem = targetm.calls.function_incoming_arg (&all->args_so_far, + tem = targetm.calls.function_incoming_arg (all->args_so_far, data->promoted_mode, data->passed_type, true); in_regs = tem != NULL; @@ -2452,7 +2458,7 @@ assign_parm_find_entry_rtl (struct assign_parm_data_all *all, { int partial; - partial = targetm.calls.arg_partial_bytes (&all->args_so_far, + partial = targetm.calls.arg_partial_bytes (all->args_so_far, data->promoted_mode, data->passed_type, data->named_arg); @@ -3388,7 +3394,7 @@ assign_parms (tree fndecl) set_decl_incoming_rtl (parm, data.entry_parm, false); /* Update info on where next arg arrives in registers. */ - targetm.calls.function_arg_advance (&all.args_so_far, data.promoted_mode, + targetm.calls.function_arg_advance (all.args_so_far, data.promoted_mode, data.passed_type, data.named_arg); assign_parm_adjust_stack_rtl (&data); @@ -3498,7 +3504,7 @@ assign_parms (tree fndecl) /* For stdarg.h function, save info about regs and stack space used by the named args. */ - crtl->args.info = all.args_so_far; + crtl->args.info = all.args_so_far_v; /* Set the rtx used for the function return value. Put this in its own variable so any optimizers that need this information don't have @@ -3587,7 +3593,7 @@ gimplify_parameters (void) continue; /* Update info on where next arg arrives in registers. */ - targetm.calls.function_arg_advance (&all.args_so_far, data.promoted_mode, + targetm.calls.function_arg_advance (all.args_so_far, data.promoted_mode, data.passed_type, data.named_arg); /* ??? Once upon a time variable_size stuffed parameter list @@ -3606,7 +3612,7 @@ gimplify_parameters (void) if (data.passed_pointer) { tree type = TREE_TYPE (data.passed_type); - if (reference_callee_copied (&all.args_so_far, TYPE_MODE (type), + if (reference_callee_copied (&all.args_so_far_v, TYPE_MODE (type), type, data.named_arg)) { tree local, t; |