This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ia64 breakage due to old powerpc64 patch
The following patch addresses this problem. The hook now returns a
number of bytes instead of a number of words. This means that the
rs6000 port no longer has to worry about trying to return a fractional
number of words.
I've tested it on alpha, i386, and ia64 linux. It cures 4 execute
failures in the ia64 testsuite.
DannyB was kind enough to build and test the rs6000 part of this
patch on powerpc-darwin, with -mpowerpc64. He reports no regressions.
I built at least cpu.o for each target that didn't simply remove the
default definition of FUNCTION_ARG_PARTIAL_NREGS, to make sure that I
introduced no syntax errors or warnings.
Committed.
r~
* target.h (targetm.calls.arg_partial_bytes): New.
* target-def.h (TARGET_ARG_PARTIAL_BYTES): New.
* calls.c (store_unaligned_arguments_into_pseudos): Update for
partial in bytes.
(load_register_parameters): Likewise.
(store_one_arg): Likewise.
(initialize_argument_information): Use targetm.calls.arg_partial_bytes.
(emit_library_call_value_1): Likewise.
* expr.c (block_move_libcall_safe_for_call_parm): Likewise.
(emit_push_insn): Update for partial in bytes.
* expr.h (FUNCTION_ARG_PARTIAL_NREGS): Remove.
* function.c (assign_parm_find_entry_rtl): Use
targetm.calls.arg_partial_bytes. Update for result in bytes.
(locate_and_pad_parm): Update for partial in bytes.
* system.h (FUNCTION_ARG_PARTIAL_NREGS): Poison.
* targhooks.c (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): New.
* targhooks.h (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Declare.
* doc/tm.texi (TARGET_ARG_PARTIAL_BYTES): Rename and update from
FUNCTION_ARG_PARTIAL_NREGS.
* config/arc/arc.h, config/c4x/c4x.h, config/i386/i386.h,
config/i860/i860.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h,
config/pdp11/pdp11.h, config/s390/s390.h, config/stormy16/stormy16.h,
config/xtensa/xtensa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove.
* config/alpha/alpha.c (alpha_arg_partial_bytes): New.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/alpha/alpha.h, config/alpha/unicosmk.h,
config/alpha/vms.h (FUNCTION_ARG_PARTIAL_NREGS): Remove.
* config/arm/arm.h (FUNCTION_ARG_PARTIAL_NREGS): Move ...
* config/arm/arm.c (arm_arg_partial_bytes): ... here.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/cris/cris.h (FUNCTION_ARG_PARTIAL_NREGS): Move ...
* config/cris/cris.c (cris_arg_partial_bytes): ... here.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/fr30/fr30.h (FUNCTION_ARG_PARTIAL_NREGS): Remove.
* config/fr30/fr30.c (fr30_arg_partial_bytes): Rename from
fr30_function_arg_partial_nregs. Adjust to return bytes.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/fr30/fr30-protos.h: Update.
* config/frv/frv.h (FUNCTION_ARG_PARTIAL_NREGS): Remove.
* config/frv/frv.c (frv_arg_partial_bytes): Rename from
frv_function_arg_partial_nregs. Adjust to return bytes.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/frv/frv-protos.h: Update.
* config/ia64/ia64.h (FUNCTION_ARG_PARTIAL_NREGS): Remove.
* config/ia64/ia64.c (ia64_arg_partial_bytes): Rename from
ia64_function_arg_partial_nregs. Adjust to return bytes.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/ia64/ia64-protos.h: Update.
* config/iq2000/iq2000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove.
* config/iq2000/iq2000.c (iq2000_arg_partial_bytes): Rename from
function_arg_partial_nregs. Adjust to return bytes.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/iq2000/iq2000-protos.h: Update.
* config/m32r/m32r.h (FUNCTION_ARG_PARTIAL_NREGS): Remove.
* config/m32r/m32r.c (m32r_arg_partial_bytes): Rename from
function_arg_partial_nregs. Adjust to return bytes.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/m32r/m32r-protos.h: Update.
* config/mcore/mcore.h (FUNCTION_ARG_PARTIAL_NREGS): Remove.
* config/mcore/mcore.c (mcore_arg_partial_bytes): Rename from
mcore_function_arg_partial_nregs. Adjust to return bytes.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/mcore/mcore-protos.h: Update.
* config/mips/mips.h (FUNCTION_ARG_PARTIAL_NREGS): Remove.
* config/mips/mips.c (mips_arg_partial_bytes): Rename from
function_arg_partial_nregs. Adjust to return bytes.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/mips/mips-protos.h: Update.
* config/mn10300/mn10300.h (FUNCTION_ARG_PARTIAL_NREGS): Remove.
* config/mn10300/mn10300.c (mn10300_arg_partial_bytes): Rename from
function_arg_partial_nregs. Adjust to return bytes.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/mn10300/mn10300-protos.h: Update.
* config/ns32k/ns32k.h (FUNCTION_ARG_PARTIAL_NREGS): Move ...
* config/ns32k/ns32k.c (ns32k_arg_partial_bytes): ... here.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/pa/pa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove.
* config/pa/pa.c (pa_arg_partial_bytes): Rename from
function_arg_partial_nregs. Handle 32-bit. Adjust to return bytes.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/pa/pa-protos.h: Update.
* config/rs6000/rs6000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove.
* config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Rename from
function_arg_partial_nregs. Adjust to return bytes.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/rs6000/rs6000-protos.h: Update.
* config/sh/sh.h (FUNCTION_ARG_PARTIAL_NREGS): Move ...
* config/sh/sh.c (sh_arg_partial_bytes): ... here.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/sparc/sparc.h (FUNCTION_ARG_PARTIAL_NREGS): Remove.
* config/sparc/sparc.c (sparc_arg_partial_bytes): Rename from
function_arg_partial_nregs. Adjust to return bytes.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/sparc/sparc-protos.h: Update.
* config/v850/v850.h (FUNCTION_ARG_PARTIAL_NREGS): Remove.
* config/v850/v850.c (v850_arg_partial_bytes): Rename from
function_arg_partial_nregs. Adjust to return bytes.
(TARGET_ARG_PARTIAL_BYTES): New.
* config/v850/v850-protos.h: Update.
Index: calls.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/calls.c,v
retrieving revision 1.374
diff -c -p -d -r1.374 calls.c
*** calls.c 23 Dec 2004 16:08:45 -0000 1.374
--- calls.c 30 Dec 2004 00:59:07 -0000
*************** store_unaligned_arguments_into_pseudos (
*** 832,841 ****
< (unsigned int) MIN (BIGGEST_ALIGNMENT, BITS_PER_WORD)))
{
int bytes = int_size_in_bytes (TREE_TYPE (args[i].tree_value));
- int nregs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
int endian_correction = 0;
! args[i].n_aligned_regs = args[i].partial ? args[i].partial : nregs;
args[i].aligned_regs = xmalloc (sizeof (rtx) * args[i].n_aligned_regs);
/* Structures smaller than a word are normally aligned to the
--- 832,850 ----
< (unsigned int) MIN (BIGGEST_ALIGNMENT, BITS_PER_WORD)))
{
int bytes = int_size_in_bytes (TREE_TYPE (args[i].tree_value));
int endian_correction = 0;
! if (args[i].partial)
! {
! gcc_assert (args[i].partial % UNITS_PER_WORD == 0);
! args[i].n_aligned_regs = args[i].partial / UNITS_PER_WORD;
! }
! else
! {
! args[i].n_aligned_regs
! = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
! }
!
args[i].aligned_regs = xmalloc (sizeof (rtx) * args[i].n_aligned_regs);
/* Structures smaller than a word are normally aligned to the
*************** initialize_argument_information (int num
*** 973,979 ****
args[i].reg is nonzero if all or part is passed in registers.
args[i].partial is nonzero if part but not all is passed in registers,
! and the exact value says how many words are passed in registers.
args[i].pass_on_stack is nonzero if the argument must at least be
computed on the stack. It may then be loaded back into registers
--- 982,988 ----
args[i].reg is nonzero if all or part is passed in registers.
args[i].partial is nonzero if part but not all is passed in registers,
! and the exact value says how many bytes are passed in registers.
args[i].pass_on_stack is nonzero if the argument must at least be
computed on the stack. It may then be loaded back into registers
*************** initialize_argument_information (int num
*** 1079,1086 ****
if (args[i].reg)
args[i].partial
! = FUNCTION_ARG_PARTIAL_NREGS (*args_so_far, mode, type,
! argpos < n_named_args);
args[i].pass_on_stack = targetm.calls.must_pass_in_stack (mode, type);
--- 1088,1095 ----
if (args[i].reg)
args[i].partial
! = targetm.calls.arg_partial_bytes (args_so_far, mode, type,
! argpos < n_named_args);
args[i].pass_on_stack = targetm.calls.must_pass_in_stack (mode, type);
*************** load_register_parameters (struct arg_dat
*** 1454,1461 ****
we just use a normal move insn. This value can be zero if the
argument is a zero size structure with no fields. */
nregs = -1;
! if (partial)
! nregs = partial;
else if (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode)
{
size = int_size_in_bytes (TREE_TYPE (args[i].tree_value));
--- 1463,1475 ----
we just use a normal move insn. This value can be zero if the
argument is a zero size structure with no fields. */
nregs = -1;
! if (GET_CODE (reg) == PARALLEL)
! ;
! else if (partial)
! {
! gcc_assert (partial % UNITS_PER_WORD == 0);
! nregs = partial / UNITS_PER_WORD;
! }
else if (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode)
{
size = int_size_in_bytes (TREE_TYPE (args[i].tree_value));
*************** emit_library_call_value_1 (int retval, r
*** 3286,3292 ****
if (mem_value && struct_value == 0 && ! pcc_struct_value)
{
rtx addr = XEXP (mem_value, 0);
- int partial;
nargs++;
--- 3300,3305 ----
*************** emit_library_call_value_1 (int retval, r
*** 3300,3307 ****
argvec[count].partial = 0;
argvec[count].reg = FUNCTION_ARG (args_so_far, Pmode, NULL_TREE, 1);
! partial = FUNCTION_ARG_PARTIAL_NREGS (args_so_far, Pmode, NULL_TREE, 1);
! gcc_assert (!partial);
locate_and_pad_parm (Pmode, NULL_TREE,
#ifdef STACK_PARMS_IN_REG_PARM_AREA
--- 3313,3320 ----
argvec[count].partial = 0;
argvec[count].reg = FUNCTION_ARG (args_so_far, Pmode, NULL_TREE, 1);
! gcc_assert (targetm.calls.arg_partial_bytes (&args_so_far, Pmode,
! NULL_TREE, 1) == 0);
locate_and_pad_parm (Pmode, NULL_TREE,
#ifdef STACK_PARMS_IN_REG_PARM_AREA
*************** emit_library_call_value_1 (int retval, r
*** 3387,3393 ****
argvec[count].reg = FUNCTION_ARG (args_so_far, mode, NULL_TREE, 1);
argvec[count].partial
! = FUNCTION_ARG_PARTIAL_NREGS (args_so_far, mode, NULL_TREE, 1);
locate_and_pad_parm (mode, NULL_TREE,
#ifdef STACK_PARMS_IN_REG_PARM_AREA
--- 3400,3406 ----
argvec[count].reg = FUNCTION_ARG (args_so_far, mode, NULL_TREE, 1);
argvec[count].partial
! = targetm.calls.arg_partial_bytes (&args_so_far, mode, NULL_TREE, 1);
locate_and_pad_parm (mode, NULL_TREE,
#ifdef STACK_PARMS_IN_REG_PARM_AREA
*************** store_one_arg (struct arg_data *arg, rtx
*** 4097,4116 ****
}
else
{
! /* PUSH_ROUNDING has no effect on us, because
! emit_push_insn for BLKmode is careful to avoid it. */
! if (reg && GET_CODE (reg) == PARALLEL)
! {
! /* Use the size of the elt to compute excess. */
! rtx elt = XEXP (XVECEXP (reg, 0, 0), 0);
! excess = (arg->locate.size.constant
! - int_size_in_bytes (TREE_TYPE (pval))
! + partial * GET_MODE_SIZE (GET_MODE (elt)));
! }
! else
! excess = (arg->locate.size.constant
! - int_size_in_bytes (TREE_TYPE (pval))
! + partial * UNITS_PER_WORD);
size_rtx = expand_expr (size_in_bytes (TREE_TYPE (pval)),
NULL_RTX, TYPE_MODE (sizetype), 0);
}
--- 4110,4120 ----
}
else
{
! /* PUSH_ROUNDING has no effect on us, because emit_push_insn
! for BLKmode is careful to avoid it. */
! excess = (arg->locate.size.constant
! - int_size_in_bytes (TREE_TYPE (pval))
! + partial);
size_rtx = expand_expr (size_in_bytes (TREE_TYPE (pval)),
NULL_RTX, TYPE_MODE (sizetype), 0);
}
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.767
diff -c -p -d -r1.767 expr.c
*** expr.c 26 Dec 2004 03:59:28 -0000 1.767
--- expr.c 30 Dec 2004 00:59:08 -0000
*************** block_move_libcall_safe_for_call_parm (v
*** 1220,1227 ****
rtx tmp = FUNCTION_ARG (args_so_far, mode, NULL_TREE, 1);
if (!tmp || !REG_P (tmp))
return false;
! if (FUNCTION_ARG_PARTIAL_NREGS (args_so_far, mode,
! NULL_TREE, 1))
return false;
FUNCTION_ARG_ADVANCE (args_so_far, mode, NULL_TREE, 1);
}
--- 1220,1226 ----
rtx tmp = FUNCTION_ARG (args_so_far, mode, NULL_TREE, 1);
if (!tmp || !REG_P (tmp))
return false;
! if (targetm.calls.arg_partial_bytes (&args_so_far, mode, NULL, 1))
return false;
FUNCTION_ARG_ADVANCE (args_so_far, mode, NULL_TREE, 1);
}
*************** emit_single_push_insn (enum machine_mode
*** 3343,3351 ****
ALIGN (in bits) is maximum alignment we can assume.
If PARTIAL and REG are both nonzero, then copy that many of the first
! words of X into registers starting with REG, and push the rest of X.
! The amount of space pushed is decreased by PARTIAL words,
! rounded *down* to a multiple of PARM_BOUNDARY.
REG must be a hard register in this case.
If REG is zero but PARTIAL is not, take any all others actions for an
argument partially in registers, but do not actually load any
--- 3342,3349 ----
ALIGN (in bits) is maximum alignment we can assume.
If PARTIAL and REG are both nonzero, then copy that many of the first
! bytes of X into registers starting with REG, and push the rest of X.
! The amount of space pushed is decreased by PARTIAL bytes.
REG must be a hard register in this case.
If REG is zero but PARTIAL is not, take any all others actions for an
argument partially in registers, but do not actually load any
*************** emit_push_insn (rtx x, enum machine_mode
*** 3397,3420 ****
/* Copy a block into the stack, entirely or partially. */
rtx temp;
! int used = partial * UNITS_PER_WORD;
int offset;
int skip;
! if (reg && GET_CODE (reg) == PARALLEL)
! {
! /* Use the size of the elt to compute offset. */
! rtx elt = XEXP (XVECEXP (reg, 0, 0), 0);
! used = partial * GET_MODE_SIZE (GET_MODE (elt));
! offset = used % (PARM_BOUNDARY / BITS_PER_UNIT);
! }
! else
! offset = used % (PARM_BOUNDARY / BITS_PER_UNIT);
gcc_assert (size);
- used -= offset;
-
/* USED is now the # of bytes we need not copy to the stack
because registers will take care of them. */
--- 3395,3409 ----
/* Copy a block into the stack, entirely or partially. */
rtx temp;
! int used;
int offset;
int skip;
! offset = partial % (PARM_BOUNDARY / BITS_PER_UNIT);
! used = partial - offset;
gcc_assert (size);
/* USED is now the # of bytes we need not copy to the stack
because registers will take care of them. */
*************** emit_push_insn (rtx x, enum machine_mode
*** 3525,3531 ****
int size = GET_MODE_SIZE (mode) / UNITS_PER_WORD;
int i;
int not_stack;
! /* # words of start of argument
that we must make space for but need not store. */
int offset = partial % (PARM_BOUNDARY / BITS_PER_WORD);
int args_offset = INTVAL (args_so_far);
--- 3514,3520 ----
int size = GET_MODE_SIZE (mode) / UNITS_PER_WORD;
int i;
int not_stack;
! /* # bytes of start of argument
that we must make space for but need not store. */
int offset = partial % (PARM_BOUNDARY / BITS_PER_WORD);
int args_offset = INTVAL (args_so_far);
*************** emit_push_insn (rtx x, enum machine_mode
*** 3546,3552 ****
/* Now NOT_STACK gets the number of words that we don't need to
allocate on the stack. */
! not_stack = partial - offset;
/* If the partial register-part of the arg counts in its stack size,
skip the part of stack space corresponding to the registers.
--- 3535,3541 ----
/* Now NOT_STACK gets the number of words that we don't need to
allocate on the stack. */
! not_stack = (partial - offset) / UNITS_PER_WORD;
/* If the partial register-part of the arg counts in its stack size,
skip the part of stack space corresponding to the registers.
*************** emit_push_insn (rtx x, enum machine_mode
*** 3630,3636 ****
if (GET_CODE (reg) == PARALLEL)
emit_group_load (reg, x, type, -1);
else
! move_block_to_reg (REGNO (reg), x, partial, mode);
}
if (extra && args_addr == 0 && where_pad == stack_direction)
--- 3619,3628 ----
if (GET_CODE (reg) == PARALLEL)
emit_group_load (reg, x, type, -1);
else
! {
! gcc_assert (partial % UNITS_PER_WORD == 0);
! move_block_to_reg (REGNO (reg), x, partial / UNITS_PER_WORD, mode);
! }
}
if (extra && args_addr == 0 && where_pad == stack_direction)
Index: expr.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.h,v
retrieving revision 1.183
diff -c -p -d -r1.183 expr.h
*** expr.h 14 Dec 2004 16:24:42 -0000 1.183
--- expr.h 30 Dec 2004 00:59:08 -0000
*************** do { \
*** 183,192 ****
#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) PARM_BOUNDARY
#endif
- #ifndef FUNCTION_ARG_PARTIAL_NREGS
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
- #endif
-
/* Supply a default definition of STACK_SAVEAREA_MODE for emit_stack_save.
Normally move_insn, so Pmode stack pointer. */
--- 183,188 ----
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.596
diff -c -p -d -r1.596 function.c
*** function.c 23 Dec 2004 00:10:45 -0000 1.596
--- function.c 30 Dec 2004 00:59:09 -0000
*************** assign_parm_find_entry_rtl (struct assig
*** 2296,2305 ****
{
int partial;
! partial = FUNCTION_ARG_PARTIAL_NREGS (all->args_so_far,
! data->promoted_mode,
! data->passed_type,
! data->named_arg);
data->partial = partial;
/* The caller might already have allocated stack space for the
--- 2296,2305 ----
{
int partial;
! partial = targetm.calls.arg_partial_bytes (&all->args_so_far,
! data->promoted_mode,
! data->passed_type,
! data->named_arg);
data->partial = partial;
/* The caller might already have allocated stack space for the
*************** assign_parm_find_entry_rtl (struct assig
*** 2325,2331 ****
argument on the stack. */
gcc_assert (!all->extra_pretend_bytes && !all->pretend_args_size);
! pretend_bytes = partial * UNITS_PER_WORD;
all->pretend_args_size = CEIL_ROUND (pretend_bytes, STACK_BYTES);
/* We want to align relative to the actual stack pointer, so
--- 2325,2331 ----
argument on the stack. */
gcc_assert (!all->extra_pretend_bytes && !all->pretend_args_size);
! pretend_bytes = partial;
all->pretend_args_size = CEIL_ROUND (pretend_bytes, STACK_BYTES);
/* We want to align relative to the actual stack pointer, so
*************** assign_parm_adjust_entry_rtl (struct ass
*** 2449,2456 ****
data->passed_type,
int_size_in_bytes (data->passed_type));
else
! move_block_from_reg (REGNO (entry_parm), validize_mem (stack_parm),
! data->partial);
entry_parm = stack_parm;
}
--- 2449,2459 ----
data->passed_type,
int_size_in_bytes (data->passed_type));
else
! {
! gcc_assert (data->partial % UNITS_PER_WORD == 0);
! move_block_from_reg (REGNO (entry_parm), validize_mem (stack_parm),
! data->partial / UNITS_PER_WORD);
! }
entry_parm = stack_parm;
}
*************** locate_and_pad_parm (enum machine_mode p
*** 3399,3409 ****
}
#endif /* REG_PARM_STACK_SPACE */
! part_size_in_regs = 0;
! if (reg_parm_stack_space == 0)
! part_size_in_regs = ((partial * UNITS_PER_WORD)
! / (PARM_BOUNDARY / BITS_PER_UNIT)
! * (PARM_BOUNDARY / BITS_PER_UNIT));
sizetree
= type ? size_in_bytes (type) : size_int (GET_MODE_SIZE (passed_mode));
--- 3402,3408 ----
}
#endif /* REG_PARM_STACK_SPACE */
! part_size_in_regs = (reg_parm_stack_space == 0 ? partial : 0);
sizetree
= type ? size_in_bytes (type) : size_int (GET_MODE_SIZE (passed_mode));
Index: system.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/system.h,v
retrieving revision 1.241
diff -c -p -d -r1.241 system.h
*** system.h 22 Dec 2004 22:06:34 -0000 1.241
--- system.h 30 Dec 2004 00:59:09 -0000
*************** extern void fancy_abort (const char *, i
*** 614,620 ****
DEFAULT_SHORT_ENUMS SPLIT_COMPLEX_ARGS MD_ASM_CLOBBERS \
HANDLE_PRAGMA_REDEFINE_EXTNAME HANDLE_PRAGMA_EXTERN_PREFIX \
MUST_PASS_IN_STACK FUNCTION_ARG_PASS_BY_REFERENCE \
! VECTOR_MODE_SUPPORTED_P TARGET_SUPPORTS_HIDDEN
/* Other obsolete target macros, or macros that used to be in target
headers and were not used, and may be obsolete or may never have
--- 614,621 ----
DEFAULT_SHORT_ENUMS SPLIT_COMPLEX_ARGS MD_ASM_CLOBBERS \
HANDLE_PRAGMA_REDEFINE_EXTNAME HANDLE_PRAGMA_EXTERN_PREFIX \
MUST_PASS_IN_STACK FUNCTION_ARG_PASS_BY_REFERENCE \
! VECTOR_MODE_SUPPORTED_P TARGET_SUPPORTS_HIDDEN \
! FUNCTION_ARG_PARTIAL_NREGS
/* Other obsolete target macros, or macros that used to be in target
headers and were not used, and may be obsolete or may never have
Index: target-def.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/target-def.h,v
retrieving revision 1.111
diff -c -p -d -r1.111 target-def.h
*** target-def.h 28 Dec 2004 04:36:31 -0000 1.111
--- target-def.h 30 Dec 2004 00:59:10 -0000
*************** Foundation, 59 Temple Place - Suite 330,
*** 399,404 ****
--- 399,405 ----
#define TARGET_MUST_PASS_IN_STACK must_pass_in_stack_var_size_or_pad
#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false
+ #define TARGET_ARG_PARTIAL_BYTES hook_int_CUMULATIVE_ARGS_mode_tree_bool_0
#define TARGET_CALLS { \
TARGET_PROMOTE_FUNCTION_ARGS, \
*************** Foundation, 59 Temple Place - Suite 330,
*** 414,420 ****
TARGET_PRETEND_OUTGOING_VARARGS_NAMED, \
TARGET_SPLIT_COMPLEX_ARG, \
TARGET_MUST_PASS_IN_STACK, \
! TARGET_CALLEE_COPIES \
}
--- 415,422 ----
TARGET_PRETEND_OUTGOING_VARARGS_NAMED, \
TARGET_SPLIT_COMPLEX_ARG, \
TARGET_MUST_PASS_IN_STACK, \
! TARGET_CALLEE_COPIES, \
! TARGET_ARG_PARTIAL_BYTES \
}
Index: target.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/target.h,v
retrieving revision 1.123
diff -c -p -d -r1.123 target.h
*** target.h 28 Dec 2004 04:36:32 -0000 1.123
--- target.h 30 Dec 2004 00:59:10 -0000
*************** struct gcc_target
*** 537,542 ****
--- 537,548 ----
the caller. It is never called for TYPE requiring constructors. */
bool (* callee_copies) (CUMULATIVE_ARGS *ca, enum machine_mode mode,
tree type, bool named);
+
+ /* Return zero for arguments passed entirely on the stack or entirely
+ in registers. If passed in both, return the number of bytes passed
+ in registers; the balance is therefore passed on the stack. */
+ int (* arg_partial_bytes) (CUMULATIVE_ARGS *ca, enum machine_mode mode,
+ tree type, bool named);
} calls;
/* Functions specific to the C++ frontend. */
Index: targhooks.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/targhooks.c,v
retrieving revision 2.35
diff -c -p -d -r2.35 targhooks.c
*** targhooks.c 23 Dec 2004 07:58:38 -0000 2.35
--- targhooks.c 30 Dec 2004 00:59:10 -0000
*************** hook_bool_CUMULATIVE_ARGS_mode_tree_bool
*** 279,281 ****
--- 279,290 ----
{
return true;
}
+
+ int
+ hook_int_CUMULATIVE_ARGS_mode_tree_bool_0 (
+ CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED)
+ {
+ return 0;
+ }
Index: targhooks.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/targhooks.h,v
retrieving revision 2.23
diff -c -p -d -r2.23 targhooks.h
*** targhooks.h 24 Sep 2004 15:13:53 -0000 2.23
--- targhooks.h 30 Dec 2004 00:59:10 -0000
*************** extern bool hook_bool_CUMULATIVE_ARGS_mo
*** 58,60 ****
--- 58,62 ----
(CUMULATIVE_ARGS *, enum machine_mode, tree, bool);
extern bool hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true
(CUMULATIVE_ARGS *, enum machine_mode, tree, bool);
+ extern int hook_int_CUMULATIVE_ARGS_mode_tree_bool_0
+ (CUMULATIVE_ARGS *, enum machine_mode, tree, bool);
Index: config/alpha/alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.404
diff -c -p -d -r1.404 alpha.c
*** config/alpha/alpha.c 28 Dec 2004 04:36:34 -0000 1.404
--- config/alpha/alpha.c 30 Dec 2004 00:59:13 -0000
*************** function_arg (CUMULATIVE_ARGS cum, enum
*** 5190,5195 ****
--- 5190,5220 ----
return gen_rtx_REG (mode, num_args + basereg);
}
+ static int
+ alpha_arg_partial_bytes (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ tree type ATTRIBUTE_UNUSED,
+ bool named ATTRIBUTE_UNUSED)
+ {
+ int words = 0;
+
+ #if TARGET_ABI_OPEN_VMS
+ if (cum->num_args < 6
+ && 6 < cum->num_args + ALPHA_ARG_SIZE (mode, type, named))
+ words = 6 - (CUM).num_args;
+ #elif TARGET_ABI_UNICOSMK
+ /* Never any split arguments. */
+ #elif TARGET_ABI_OSF
+ if (*cum < 6 && 6 < *cum + ALPHA_ARG_SIZE (mode, type, named))
+ words = 6 - *cum;
+ #else
+ #error Unhandled ABI
+ #endif
+
+ return words * UNITS_PER_WORD;
+ }
+
+
/* Return true if TYPE must be returned in memory, instead of in registers. */
static bool
*************** alpha_init_libfuncs (void)
*** 9453,9458 ****
--- 9478,9485 ----
#define TARGET_SPLIT_COMPLEX_ARG alpha_split_complex_arg
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
#define TARGET_GIMPLIFY_VA_ARG_EXPR alpha_gimplify_va_arg
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES alpha_arg_partial_bytes
#undef TARGET_SCALAR_MODE_SUPPORTED_P
#define TARGET_SCALAR_MODE_SUPPORTED_P alpha_scalar_mode_supported_p
Index: config/alpha/alpha.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.h,v
retrieving revision 1.235
diff -c -p -d -r1.235 alpha.h
*** config/alpha/alpha.h 27 Oct 2004 01:29:40 -0000 1.235
--- config/alpha/alpha.h 30 Dec 2004 00:59:13 -0000
*************** extern int alpha_memory_latency;
*** 1067,1080 ****
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg((CUM), (MODE), (TYPE), (NAMED))
- /* For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
- For args passed entirely in registers or entirely in memory, zero. */
-
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- ((CUM) < 6 && 6 < (CUM) + ALPHA_ARG_SIZE (MODE, TYPE, NAMED) \
- ? 6 - (CUM) : 0)
-
/* Try to output insns to set TARGET equal to the constant C if it can be
done in less than N insns. Do all computations in MODE. Returns the place
where the output has been placed if it can be done and the insns have been
--- 1067,1072 ----
Index: config/alpha/unicosmk.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/unicosmk.h,v
retrieving revision 1.34
diff -c -p -d -r1.34 unicosmk.h
*** config/alpha/unicosmk.h 21 Oct 2004 00:53:32 -0000 1.34
--- config/alpha/unicosmk.h 30 Dec 2004 00:59:13 -0000
*************** do { \
*** 210,220 ****
++(CUM).num_args; \
} while(0)
- /* An argument is passed either entirely in registers or entirely on stack. */
-
- #undef FUNCTION_ARG_PARTIAL_NREGS
- /* #define FUNCTION_ARG_PARTIAL_NREGS(CUM,MODE,TYPE,NAMED) 0 */
-
/* This ensures that $15 increments/decrements in leaf functions won't get
eliminated. */
--- 210,215 ----
Index: config/alpha/vms.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/vms.h,v
retrieving revision 1.83
diff -c -p -d -r1.83 vms.h
*** config/alpha/vms.h 8 Sep 2004 00:17:13 -0000 1.83
--- config/alpha/vms.h 30 Dec 2004 00:59:13 -0000
*************** typedef struct {int num_args; enum avms_
*** 189,204 ****
(CUM).num_args += ALPHA_ARG_SIZE (MODE, TYPE, NAMED); \
}
- /* For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
- For args passed entirely in registers or entirely in memory, zero. */
-
- #undef FUNCTION_ARG_PARTIAL_NREGS
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- ((CUM).num_args < 6 && 6 < (CUM).num_args \
- + ALPHA_ARG_SIZE (MODE, TYPE, NAMED) \
- ? 6 - (CUM).num_args : 0)
-
/* ABI has stack checking, but it's broken. */
#undef STACK_CHECK_BUILTIN
#define STACK_CHECK_BUILTIN 0
--- 189,194 ----
Index: config/arc/arc.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arc/arc.h,v
retrieving revision 1.81
diff -c -p -d -r1.81 arc.h
*** config/arc/arc.h 20 Oct 2004 02:21:04 -0000 1.81
--- config/arc/arc.h 30 Dec 2004 00:59:13 -0000
*************** extern enum reg_class arc_regno_reg_clas
*** 681,701 ****
? gen_rtx_REG ((MODE), ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE))) \
: 0)
- /* A C expression for the number of words, at the beginning of an
- argument, must be put in registers. The value must be zero for
- arguments that are passed entirely in registers or that are entirely
- pushed on the stack.
-
- On some machines, certain arguments must be passed partially in
- registers and partially in memory. On these machines, typically the
- first @var{n} words of arguments are passed in registers, and the rest
- on the stack. If a multi-word argument (a @code{double} or a
- structure) crosses that boundary, its first few words must be passed
- in registers and the rest must be pushed. This macro tells the
- compiler when this occurs, and how many of the words should go in
- registers. */
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
-
/* Update the data in CUM to advance over an argument
of mode MODE and data type TYPE.
(TYPE is null for libcalls where that information may not be available.) */
--- 681,686 ----
Index: config/arm/arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.423
diff -c -p -d -r1.423 arm.c
*** config/arm/arm.c 15 Dec 2004 14:03:58 -0000 1.423
--- config/arm/arm.c 30 Dec 2004 00:59:16 -0000
*************** static rtx arm_expand_binop_builtin (enu
*** 147,152 ****
--- 147,154 ----
static rtx arm_expand_unop_builtin (enum insn_code, tree, rtx, int);
static rtx arm_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
static void emit_constant_insn (rtx cond, rtx pattern);
+ static int arm_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, bool);
#ifndef ARM_PE
static void arm_encode_section_info (tree, rtx, int);
*************** static unsigned HOST_WIDE_INT arm_shift_
*** 272,277 ****
--- 274,281 ----
#define TARGET_PROMOTE_PROTOTYPES arm_promote_prototypes
#undef TARGET_PASS_BY_REFERENCE
#define TARGET_PASS_BY_REFERENCE arm_pass_by_reference
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES arm_arg_partial_bytes
#undef TARGET_STRUCT_VALUE_RTX
#define TARGET_STRUCT_VALUE_RTX arm_struct_value_rtx
*************** arm_function_arg (CUMULATIVE_ARGS *pcum,
*** 2527,2532 ****
--- 2531,2553 ----
return gen_rtx_REG (mode, pcum->nregs);
}
+ static int
+ arm_arg_partial_bytes (CUMULATIVE_ARGS *pcum, enum machine_mode mode,
+ tree type, bool named ATTRIBUTE_UNUSED)
+ {
+ int nregs = pcum->nregs;
+
+ if (arm_vector_mode_supported_p (mode))
+ return 0;
+
+ if (NUM_ARG_REGS > nregs
+ && (NUM_ARG_REGS < nregs + ARM_NUM_REGS2 (mode, type))
+ && pcum->can_split)
+ return (NUM_ARG_REGS - nregs) * UNITS_PER_WORD;
+
+ return 0;
+ }
+
/* Variable sized types are passed by reference. This is a GCC
extension to the ARM ABI. */
Index: config/arm/arm.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.h,v
retrieving revision 1.262
diff -c -p -d -r1.262 arm.h
*** config/arm/arm.h 20 Nov 2004 11:21:55 -0000 1.262
--- config/arm/arm.h 30 Dec 2004 00:59:16 -0000
*************** typedef struct
*** 1743,1758 ****
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
arm_function_arg (&(CUM), (MODE), (TYPE), (NAMED))
- /* For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
- For args passed entirely in registers or entirely in memory, zero. */
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- (arm_vector_mode_supported_p (MODE) ? 0 : \
- NUM_ARG_REGS > (CUM).nregs \
- && (NUM_ARG_REGS < ((CUM).nregs + ARM_NUM_REGS2 (MODE, TYPE)) \
- && (CUM).can_split) \
- ? NUM_ARG_REGS - (CUM).nregs : 0)
-
/* Initialize a variable CUM of type CUMULATIVE_ARGS
for a call to a function whose data type is FNTYPE.
For a library call, FNTYPE is 0.
--- 1743,1748 ----
Index: config/c4x/c4x.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/c4x/c4x.h,v
retrieving revision 1.150
diff -c -p -d -r1.150 c4x.h
*** config/c4x/c4x.h 24 Nov 2004 19:45:10 -0000 1.150
--- config/c4x/c4x.h 30 Dec 2004 00:59:17 -0000
*************** CUMULATIVE_ARGS;
*** 1128,1135 ****
#define CALLER_SAVE_PROFITABLE(REFS,CALLS) 0
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
-
/* 1 if N is a possible register number for function argument passing. */
#define FUNCTION_ARG_REGNO_P(REGNO) \
--- 1128,1133 ----
Index: config/cris/cris.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/cris.c,v
retrieving revision 1.61
diff -c -p -d -r1.61 cris.c
*** config/cris/cris.c 18 Sep 2004 19:19:31 -0000 1.61
--- config/cris/cris.c 30 Dec 2004 00:59:17 -0000
*************** static bool cris_rtx_costs (rtx, int, in
*** 117,122 ****
--- 117,124 ----
static int cris_address_cost (rtx);
static bool cris_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
+ static int cris_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, bool);
/* The function cris_target_asm_function_epilogue puts the last insn to
output here. It always fits; there won't be a symbol operand. Used in
*************** int cris_cpu_version = CRIS_DEFAULT_CPU_
*** 191,196 ****
--- 193,200 ----
#define TARGET_SETUP_INCOMING_VARARGS cris_setup_incoming_varargs
#undef TARGET_PASS_BY_REFERENCE
#define TARGET_PASS_BY_REFERENCE cris_pass_by_reference
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES cris_arg_partial_bytes
struct gcc_target targetm = TARGET_INITIALIZER;
*************** cris_pass_by_reference (CUMULATIVE_ARGS
*** 3184,3189 ****
--- 3188,3207 ----
}
+ static int
+ cris_arg_partial_bytes (CUMULATIVE_ARGS *ca, enum machine_mode mode,
+ tree type, bool named ATTRIBUTE_UNUSED)
+ {
+ if (ca->regs == CRIS_MAX_ARGS_IN_REGS - 1
+ && !targetm.calls.must_pass_in_stack (mode, type)
+ && CRIS_FUNCTION_ARG_SIZE (mode, type) > 4
+ && CRIS_FUNCTION_ARG_SIZE (mode, type) <= 8)
+ return UNITS_PER_WORD;
+ else
+ return 0;
+ }
+
+
#if 0
/* Various small functions to replace macros. Only called from a
debugger. They might collide with gcc functions or system functions,
Index: config/cris/cris.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/cris.h,v
retrieving revision 1.79
diff -c -p -d -r1.79 cris.h
*** config/cris/cris.h 19 Sep 2004 04:02:34 -0000 1.79
--- config/cris/cris.h 30 Dec 2004 00:59:18 -0000
*************** enum reg_class {NO_REGS, ALL_REGS, LIM_R
*** 953,965 ****
? gen_rtx_REG (MODE, CRIS_FIRST_ARG_REG + (CUM).regs) \
: NULL_RTX)
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- (((CUM).regs == (CRIS_MAX_ARGS_IN_REGS - 1) \
- && !targetm.calls.must_pass_in_stack (MODE, TYPE) \
- && CRIS_FUNCTION_ARG_SIZE (MODE, TYPE) > 4 \
- && CRIS_FUNCTION_ARG_SIZE (MODE, TYPE) <= 8) \
- ? 1 : 0)
-
/* Contrary to what you'd believe, defining FUNCTION_ARG_CALLEE_COPIES
seems like a (small total) loss, at least for gcc-2.7.2 compiling and
running gcc-2.1 (small win in size, small loss running -- 100.1%),
--- 953,958 ----
Index: config/fr30/fr30-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/fr30/fr30-protos.h,v
retrieving revision 1.10
diff -c -p -d -r1.10 fr30-protos.h
*** config/fr30/fr30-protos.h 8 Jul 2004 22:38:18 -0000 1.10
--- config/fr30/fr30-protos.h 30 Dec 2004 00:59:18 -0000
*************** extern void fr30_print_operand_address
*** 29,36 ****
extern rtx fr30_move_double (rtx *);
#ifdef TREE_CODE
extern int fr30_num_arg_regs (enum machine_mode, tree);
- extern int fr30_function_arg_partial_nregs (CUMULATIVE_ARGS,
- enum machine_mode, tree, int);
#endif /* TREE_CODE */
#ifdef HAVE_MACHINE_MODES
#define Mmode enum machine_mode
--- 29,34 ----
Index: config/fr30/fr30.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/fr30/fr30.c,v
retrieving revision 1.46
diff -c -p -d -r1.46 fr30.c
*** config/fr30/fr30.c 18 Sep 2004 19:19:32 -0000 1.46
--- config/fr30/fr30.c 30 Dec 2004 00:59:18 -0000
*************** static struct fr30_frame_info zero_fram
*** 124,129 ****
--- 124,132 ----
static void fr30_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
tree, int *, int);
static bool fr30_must_pass_in_stack (enum machine_mode, tree);
+ static int fr30_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, bool);
+
#define FRAME_POINTER_MASK (1 << (FRAME_POINTER_REGNUM))
#define RETURN_POINTER_MASK (1 << (RETURN_POINTER_REGNUM))
*************** static bool fr30_must_pass_in_stack (enu
*** 154,159 ****
--- 157,164 ----
#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true
#undef TARGET_PASS_BY_REFERENCE
#define TARGET_PASS_BY_REFERENCE hook_pass_by_reference_must_pass_in_stack
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES fr30_arg_partial_bytes
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS fr30_setup_incoming_varargs
*************** fr30_num_arg_regs (enum machine_mode mod
*** 697,718 ****
return (size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
}
! /* Implements the FUNCTION_ARG_PARTIAL_NREGS macro.
! Returns the number of argument registers required to hold *part* of
! a parameter of machine mode MODE and tree type TYPE (which may be
! NULL if the type is not known). If the argument fits entirely in
! the argument registers, or entirely on the stack, then 0 is returned.
CUM is the number of argument registers already used by earlier
parameters to the function. */
! int
! fr30_function_arg_partial_nregs (CUMULATIVE_ARGS cum, enum machine_mode mode,
! tree type, int named)
{
/* Unnamed arguments, i.e. those that are prototyped as ...
are always passed on the stack.
Also check here to see if all the argument registers are full. */
! if (named == 0 || cum >= FR30_NUM_ARG_REGS)
return 0;
/* Work out how many argument registers would be needed if this
--- 702,722 ----
return (size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
}
! /* Returns the number of bytes in which *part* of a parameter of machine
! mode MODE and tree type TYPE (which may be NULL if the type is not known).
! If the argument fits entirely in the argument registers, or entirely on
! the stack, then 0 is returned.
CUM is the number of argument registers already used by earlier
parameters to the function. */
! static int
! fr30_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type, bool named)
{
/* Unnamed arguments, i.e. those that are prototyped as ...
are always passed on the stack.
Also check here to see if all the argument registers are full. */
! if (named == 0 || *cum >= FR30_NUM_ARG_REGS)
return 0;
/* Work out how many argument registers would be needed if this
*************** fr30_function_arg_partial_nregs (CUMULAT
*** 721,731 ****
are needed because the parameter must be passed on the stack)
then return zero, as this parameter does not require partial
register, partial stack stack space. */
! if (cum + fr30_num_arg_regs (mode, type) <= FR30_NUM_ARG_REGS)
return 0;
! /* Otherwise return the number of registers that would be used. */
! return FR30_NUM_ARG_REGS - cum;
}
/*}}}*/
--- 725,734 ----
are needed because the parameter must be passed on the stack)
then return zero, as this parameter does not require partial
register, partial stack stack space. */
! if (*cum + fr30_num_arg_regs (mode, type) <= FR30_NUM_ARG_REGS)
return 0;
! return (FR30_NUM_ARG_REGS - *cum) * UNITS_PER_WORD;
}
/*}}}*/
Index: config/fr30/fr30.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/fr30/fr30.h,v
retrieving revision 1.59
diff -c -p -d -r1.59 fr30.h
*** config/fr30/fr30.h 18 Sep 2004 19:19:32 -0000 1.59
--- config/fr30/fr30.h 30 Dec 2004 00:59:18 -0000
*************** enum reg_class
*** 676,699 ****
the number of bytes of argument accumulated so far. */
#define CUMULATIVE_ARGS int
- /* A C expression for the number of words, at the beginning of an argument,
- must be put in registers. The value must be zero for arguments that are
- passed entirely in registers or that are entirely pushed on the stack.
-
- On some machines, certain arguments must be passed partially in registers
- and partially in memory. On these machines, typically the first N words of
- arguments are passed in registers, and the rest on the stack. If a
- multi-word argument (a `double' or a structure) crosses that boundary, its
- first few words must be passed in registers and the rest must be pushed.
- This macro tells the compiler when this occurs, and how many of the words
- should go in registers.
-
- `FUNCTION_ARG' for these arguments should return the first register to be
- used by the caller for this argument; likewise `FUNCTION_INCOMING_ARG', for
- the called function. */
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- fr30_function_arg_partial_nregs (CUM, MODE, TYPE, NAMED)
-
/* A C statement (sans semicolon) for initializing the variable CUM for the
state at the beginning of the argument list. The variable has type
`CUMULATIVE_ARGS'. The value of FNTYPE is the tree node for the data type
--- 676,681 ----
Index: config/frv/frv-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/frv/frv-protos.h,v
retrieving revision 1.22
diff -c -p -d -r1.22 frv-protos.h
*** config/frv/frv-protos.h 10 Dec 2004 16:33:25 -0000 1.22
--- config/frv/frv-protos.h 30 Dec 2004 00:59:18 -0000
*************** extern void frv_function_arg_advance (C
*** 84,93 ****
enum machine_mode,
tree, int);
- extern int frv_function_arg_partial_nregs (CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int);
-
extern void frv_expand_builtin_va_start (tree, rtx);
#endif /* TREE_CODE */
--- 84,89 ----
Index: config/frv/frv.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/frv/frv.c,v
retrieving revision 1.77
diff -c -p -d -r1.77 frv.c
*** config/frv/frv.c 10 Dec 2004 16:33:25 -0000 1.77
--- config/frv/frv.c 30 Dec 2004 00:59:20 -0000
*************** static void frv_output_const_unspec (FI
*** 376,381 ****
--- 376,383 ----
static bool frv_function_ok_for_sibcall (tree, tree);
static rtx frv_struct_value_rtx (tree, int);
static bool frv_must_pass_in_stack (enum machine_mode mode, tree type);
+ static int frv_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, bool);
/* Initialize the GCC target structure. */
#undef TARGET_ASM_FUNCTION_PROLOGUE
*************** static bool frv_must_pass_in_stack (enum
*** 418,423 ****
--- 420,427 ----
#define TARGET_MUST_PASS_IN_STACK frv_must_pass_in_stack
#undef TARGET_PASS_BY_REFERENCE
#define TARGET_PASS_BY_REFERENCE hook_pass_by_reference_must_pass_in_stack
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES frv_arg_partial_bytes
#undef TARGET_EXPAND_BUILTIN_SAVEREGS
#define TARGET_EXPAND_BUILTIN_SAVEREGS frv_expand_builtin_saveregs
*************** frv_function_arg_advance (CUMULATIVE_ARG
*** 3192,3202 ****
used by the caller for this argument; likewise `FUNCTION_INCOMING_ARG', for
the called function. */
! int
! frv_function_arg_partial_nregs (CUMULATIVE_ARGS *cum,
! enum machine_mode mode,
! tree type ATTRIBUTE_UNUSED,
! int named ATTRIBUTE_UNUSED)
{
enum machine_mode xmode = (mode == BLKmode) ? SImode : mode;
int bytes = GET_MODE_SIZE (xmode);
--- 3196,3204 ----
used by the caller for this argument; likewise `FUNCTION_INCOMING_ARG', for
the called function. */
! static int
! frv_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type ATTRIBUTE_UNUSED, bool named ATTRIBUTE_UNUSED)
{
enum machine_mode xmode = (mode == BLKmode) ? SImode : mode;
int bytes = GET_MODE_SIZE (xmode);
*************** frv_function_arg_partial_nregs (CUMULATI
*** 3207,3218 ****
ret = ((arg_num <= LAST_ARG_REGNUM && arg_num + words > LAST_ARG_REGNUM+1)
? LAST_ARG_REGNUM - arg_num + 1
: 0);
if (TARGET_DEBUG_ARG && ret)
! fprintf (stderr, "function_arg_partial_nregs: %d\n", ret);
return ret;
-
}
--- 3209,3220 ----
ret = ((arg_num <= LAST_ARG_REGNUM && arg_num + words > LAST_ARG_REGNUM+1)
? LAST_ARG_REGNUM - arg_num + 1
: 0);
+ ret *= UNITS_PER_WORD;
if (TARGET_DEBUG_ARG && ret)
! fprintf (stderr, "frv_arg_partial_bytes: %d\n", ret);
return ret;
}
Index: config/frv/frv.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/frv/frv.h,v
retrieving revision 1.56
diff -c -p -d -r1.56 frv.h
*** config/frv/frv.h 10 Dec 2004 16:33:25 -0000 1.56
--- config/frv/frv.h 30 Dec 2004 00:59:21 -0000
*************** struct machine_function GTY(())
*** 1884,1909 ****
#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
frv_function_arg (&CUM, MODE, TYPE, NAMED, TRUE)
- /* A C expression for the number of words, at the beginning of an argument,
- must be put in registers. The value must be zero for arguments that are
- passed entirely in registers or that are entirely pushed on the stack.
-
- On some machines, certain arguments must be passed partially in registers
- and partially in memory. On these machines, typically the first N words of
- arguments are passed in registers, and the rest on the stack. If a
- multi-word argument (a `double' or a structure) crosses that boundary, its
- first few words must be passed in registers and the rest must be pushed.
- This macro tells the compiler when this occurs, and how many of the words
- should go in registers.
-
- `FUNCTION_ARG' for these arguments should return the first register to be
- used by the caller for this argument; likewise `FUNCTION_INCOMING_ARG', for
- the called function. */
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- frv_function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)
-
- /* extern int frv_function_arg_partial_nregs (CUMULATIVE_ARGS, int, Tree, int); */
-
/* A C type for declaring a variable that is used as the first argument of
`FUNCTION_ARG' and other related values. For some target machines, the type
`int' suffices and can hold the number of bytes of argument so far.
--- 1884,1889 ----
Index: config/i386/i386.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.h,v
retrieving revision 1.414
diff -c -p -d -r1.414 i386.h
*** config/i386/i386.h 27 Dec 2004 09:35:46 -0000 1.414
--- config/i386/i386.h 30 Dec 2004 00:59:21 -0000
*************** typedef struct ix86_args {
*** 1777,1788 ****
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&(CUM), (MODE), (TYPE), (NAMED))
- /* For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
- For args passed entirely in registers or entirely in memory, zero. */
-
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
-
/* Implement `va_start' for varargs and stdarg. */
#define EXPAND_BUILTIN_VA_START(VALIST, NEXTARG) \
ix86_va_start (VALIST, NEXTARG)
--- 1777,1782 ----
Index: config/i860/i860.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i860/i860.h,v
retrieving revision 1.45
diff -c -p -d -r1.45 i860.h
*** config/i860/i860.h 8 Jul 2004 23:37:00 -0000 1.45
--- config/i860/i860.h 30 Dec 2004 00:59:22 -0000
*************** struct cumulative_args { int ints, float
*** 529,540 ****
: 0) \
: 0)
- /* For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
- For args passed entirely in registers or entirely in memory, zero. */
-
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
-
/* If defined, a C expression that gives the alignment boundary, in
bits, of an argument with the specified mode and type. If it is
not defined, `PARM_BOUNDARY' is used for all arguments. */
--- 529,534 ----
Index: config/ia64/ia64-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64-protos.h,v
retrieving revision 1.67
diff -c -p -d -r1.67 ia64-protos.h
*** config/ia64/ia64-protos.h 6 Oct 2004 16:07:03 -0000 1.67
--- config/ia64/ia64-protos.h 30 Dec 2004 00:59:22 -0000
*************** extern rtx ia64_va_arg (tree, tree);
*** 73,80 ****
extern rtx ia64_function_value (tree, tree);
#endif /* RTX_CODE */
- extern int ia64_function_arg_partial_nregs (CUMULATIVE_ARGS *,
- enum machine_mode, tree, int);
extern void ia64_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
tree, int);
extern int ia64_function_arg_boundary (enum machine_mode, tree);
--- 73,78 ----
Index: config/ia64/ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.335
diff -c -p -d -r1.335 ia64.c
*** config/ia64/ia64.c 28 Dec 2004 04:36:36 -0000 1.335
--- config/ia64/ia64.c 30 Dec 2004 00:59:23 -0000
*************** static void ia64_setup_incoming_varargs
*** 191,196 ****
--- 191,198 ----
tree, int *, int);
static bool ia64_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
+ static int ia64_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, bool);
static bool ia64_function_ok_for_sibcall (tree, tree);
static bool ia64_return_in_memory (tree, tree);
static bool ia64_rtx_costs (rtx, int, int, int *);
*************** static const struct attribute_spec ia64_
*** 362,367 ****
--- 364,371 ----
#define TARGET_FUNCTION_OK_FOR_SIBCALL ia64_function_ok_for_sibcall
#undef TARGET_PASS_BY_REFERENCE
#define TARGET_PASS_BY_REFERENCE ia64_pass_by_reference
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES ia64_arg_partial_bytes
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK ia64_output_mi_thunk
*************** ia64_function_arg (CUMULATIVE_ARGS *cum,
*** 3250,3262 ****
}
}
! /* Return number of words, at the beginning of the argument, that must be
put in registers. 0 is the argument is entirely in registers or entirely
in memory. */
! int
! ia64_function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type, int named ATTRIBUTE_UNUSED)
{
int words = ia64_function_arg_words (type, mode);
int offset = ia64_function_arg_offset (cum, type, words);
--- 3254,3266 ----
}
}
! /* Return number of bytes, at the beginning of the argument, that must be
put in registers. 0 is the argument is entirely in registers or entirely
in memory. */
! static int
! ia64_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type, bool named ATTRIBUTE_UNUSED)
{
int words = ia64_function_arg_words (type, mode);
int offset = ia64_function_arg_offset (cum, type, words);
*************** ia64_function_arg_partial_nregs (CUMULAT
*** 3273,3279 ****
if (words + cum->words + offset <= MAX_ARGUMENT_SLOTS)
return 0;
! return MAX_ARGUMENT_SLOTS - cum->words - offset;
}
/* Update CUM to point after this argument. This is patterned after
--- 3277,3283 ----
if (words + cum->words + offset <= MAX_ARGUMENT_SLOTS)
return 0;
! return (MAX_ARGUMENT_SLOTS - cum->words - offset) * UNITS_PER_WORD;
}
/* Update CUM to point after this argument. This is patterned after
Index: config/ia64/ia64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.h,v
retrieving revision 1.188
diff -c -p -d -r1.188 ia64.h
*** config/ia64/ia64.h 11 Nov 2004 21:20:22 -0000 1.188
--- config/ia64/ia64.h 30 Dec 2004 00:59:23 -0000
*************** enum reg_class
*** 1326,1338 ****
#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
ia64_function_arg (&CUM, MODE, TYPE, NAMED, 1)
- /* A C expression for the number of words, at the beginning of an argument,
- must be put in registers. The value must be zero for arguments that are
- passed entirely in registers or that are entirely pushed on the stack. */
-
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- ia64_function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)
-
/* A C type for declaring a variable that is used as the first argument of
`FUNCTION_ARG' and other related values. For some target machines, the type
`int' suffices and can hold the number of bytes of argument so far. */
--- 1326,1331 ----
Index: config/iq2000/iq2000-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/iq2000/iq2000-protos.h,v
retrieving revision 1.7
diff -c -p -d -r1.7 iq2000-protos.h
*** config/iq2000/iq2000-protos.h 14 Jul 2004 06:24:16 -0000 1.7
--- config/iq2000/iq2000-protos.h 30 Dec 2004 00:59:24 -0000
*************** extern void gen_conditional_
*** 49,55 ****
extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx);
extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
extern struct rtx_def * function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
- extern int function_arg_partial_nregs (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
extern void iq2000_va_start (tree, rtx);
extern rtx iq2000_function_value (tree, tree);
#endif
--- 49,54 ----
Index: config/iq2000/iq2000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/iq2000/iq2000.c,v
retrieving revision 1.30
diff -c -p -d -r1.30 iq2000.c
*** config/iq2000/iq2000.c 9 Nov 2004 10:13:05 -0000 1.30
--- config/iq2000/iq2000.c 30 Dec 2004 00:59:24 -0000
*************** static void iq2000_select_section (t
*** 174,179 ****
--- 174,181 ----
static bool iq2000_return_in_memory (tree, tree);
static bool iq2000_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
+ static int iq2000_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, bool);
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS iq2000_init_builtins
*************** static bool iq2000_pass_by_reference (C
*** 201,206 ****
--- 203,210 ----
#define TARGET_PASS_BY_REFERENCE iq2000_pass_by_reference
#undef TARGET_CALLEE_COPIES
#define TARGET_CALLEE_COPIES hook_callee_copies_named
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES iq2000_arg_partial_bytes
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS iq2000_setup_incoming_varargs
*************** function_arg (CUMULATIVE_ARGS *cum, enum
*** 1552,1569 ****
return ret;
}
! int
! function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type ATTRIBUTE_UNUSED,
! int named ATTRIBUTE_UNUSED)
{
! if (mode == DImode
! && cum->arg_words == MAX_ARGS_IN_REGISTERS - (unsigned)1)
{
if (TARGET_DEBUG_D_MODE)
! fprintf (stderr, "function_arg_partial_nregs = 1\n");
!
! return 1;
}
return 0;
--- 1556,1571 ----
return ret;
}
! static int
! iq2000_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type ATTRIBUTE_UNUSED,
! bool named ATTRIBUTE_UNUSED)
{
! if (mode == DImode && cum->arg_words == MAX_ARGS_IN_REGISTERS - 1)
{
if (TARGET_DEBUG_D_MODE)
! fprintf (stderr, "iq2000_arg_partial_bytes=%d\n", UNITS_PER_WORD);
! return UNITS_PER_WORD;
}
return 0;
Index: config/iq2000/iq2000.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/iq2000/iq2000.h,v
retrieving revision 1.18
diff -c -p -d -r1.18 iq2000.h
*** config/iq2000/iq2000.h 18 Sep 2004 19:19:35 -0000 1.18
--- config/iq2000/iq2000.h 30 Dec 2004 00:59:24 -0000
*************** enum reg_class
*** 438,446 ****
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (& CUM, MODE, TYPE, NAMED)
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- function_arg_partial_nregs (& CUM, MODE, TYPE, NAMED)
-
#define MAX_ARGS_IN_REGISTERS 8
typedef struct iq2000_args
--- 438,443 ----
Index: config/m32r/m32r-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m32r/m32r-protos.h,v
retrieving revision 1.26
diff -c -p -d -r1.26 m32r-protos.h
*** config/m32r/m32r-protos.h 14 Jul 2004 06:24:17 -0000 1.26
--- config/m32r/m32r-protos.h 30 Dec 2004 00:59:24 -0000
*************** extern void m32r_load_pic_register (vo
*** 35,44 ****
#ifdef TREE_CODE
extern enum m32r_function_type m32r_compute_function_type (tree);
-
- #ifdef HAVE_MACHINE_MODES
- extern int function_arg_partial_nregs (CUMULATIVE_ARGS *, Mmode, tree, int);
- #endif
#endif /* TREE_CODE */
#ifdef RTX_CODE
--- 35,40 ----
Index: config/m32r/m32r.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m32r/m32r.c,v
retrieving revision 1.109
diff -c -p -d -r1.109 m32r.c
*** config/m32r/m32r.c 15 Dec 2004 12:13:07 -0000 1.109
--- config/m32r/m32r.c 30 Dec 2004 00:59:25 -0000
*************** static void init_idents (void);
*** 102,107 ****
--- 102,109 ----
static bool m32r_rtx_costs (rtx, int, int, int *);
static bool m32r_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
+ static int m32r_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, bool);
/* Initialize the GCC target structure. */
#undef TARGET_ATTRIBUTE_TABLE
*************** static bool m32r_pass_by_reference (CUMU
*** 145,150 ****
--- 147,154 ----
#define TARGET_MUST_PASS_IN_STACK must_pass_in_stack_var_size
#undef TARGET_PASS_BY_REFERENCE
#define TARGET_PASS_BY_REFERENCE m32r_pass_by_reference
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES m32r_arg_partial_bytes
struct gcc_target targetm = TARGET_INITIALIZER;
*************** gen_split_move_double (rtx operands[])
*** 1321,1333 ****
}
! /* Implements the FUNCTION_ARG_PARTIAL_NREGS macro. */
!
! int
! function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type, int named ATTRIBUTE_UNUSED)
{
! int ret;
unsigned int size =
(((mode == BLKmode && type)
? (unsigned int) int_size_in_bytes (type)
--- 1325,1335 ----
}
! static int
! m32r_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type, bool named ATTRIBUTE_UNUSED)
{
! int words;
unsigned int size =
(((mode == BLKmode && type)
? (unsigned int) int_size_in_bytes (type)
*************** function_arg_partial_nregs (CUMULATIVE_A
*** 1335,1347 ****
/ UNITS_PER_WORD;
if (*cum >= M32R_MAX_PARM_REGS)
! ret = 0;
else if (*cum + size > M32R_MAX_PARM_REGS)
! ret = (*cum + size) - M32R_MAX_PARM_REGS;
else
! ret = 0;
! return ret;
}
/* Worker function for TARGET_RETURN_IN_MEMORY. */
--- 1337,1349 ----
/ UNITS_PER_WORD;
if (*cum >= M32R_MAX_PARM_REGS)
! words = 0;
else if (*cum + size > M32R_MAX_PARM_REGS)
! words = (*cum + size) - M32R_MAX_PARM_REGS;
else
! words = 0;
! return words * UNITS_PER_WORD;
}
/* Worker function for TARGET_RETURN_IN_MEMORY. */
Index: config/m32r/m32r.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m32r/m32r.h,v
retrieving revision 1.124
diff -c -p -d -r1.124 m32r.h
*** config/m32r/m32r.h 15 Dec 2004 11:53:44 -0000 1.124
--- config/m32r/m32r.h 30 Dec 2004 00:59:25 -0000
*************** extern enum reg_class m32r_regno_reg_cla
*** 1099,1120 ****
? gen_rtx_REG ((MODE), ROUND_ADVANCE_CUM ((CUM), (MODE), (TYPE))) \
: 0)
- /* A C expression for the number of words, at the beginning of an
- argument, must be put in registers. The value must be zero for
- arguments that are passed entirely in registers or that are entirely
- pushed on the stack.
-
- On some machines, certain arguments must be passed partially in
- registers and partially in memory. On these machines, typically the
- first @var{n} words of arguments are passed in registers, and the rest
- on the stack. If a multi-word argument (a @code{double} or a
- structure) crosses that boundary, its first few words must be passed
- in registers and the rest must be pushed. This macro tells the
- compiler when this occurs, and how many of the words should go in
- registers. */
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- function_arg_partial_nregs (&CUM, (int)MODE, TYPE, NAMED)
-
/* Update the data in CUM to advance over an argument
of mode MODE and data type TYPE.
(TYPE is null for libcalls where that information may not be available.) */
--- 1099,1104 ----
Index: config/m68hc11/m68hc11.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68hc11/m68hc11.h,v
retrieving revision 1.89
diff -c -p -d -r1.89 m68hc11.h
*** config/m68hc11/m68hc11.h 8 Sep 2004 18:45:05 -0000 1.89
--- config/m68hc11/m68hc11.h 30 Dec 2004 00:59:26 -0000
*************** typedef struct m68hc11_args
*** 1083,1096 ****
caller saving results in spill failure. */
#define CALLER_SAVE_PROFITABLE(REFS,CALLS) 0
- /* For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
- For args passed entirely in registers or entirely in memory, zero.
-
- Passing an arg partly in register and memory does not work at all.
- Don't do that. */
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) (0)
-
/* 1 if N is a possible register number for function argument passing.
D is for 16-bit values, X is for 32-bit (X+D). */
#define FUNCTION_ARG_REGNO_P(N) \
--- 1083,1088 ----
Index: config/m68k/m68k.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/m68k.h,v
retrieving revision 1.122
diff -c -p -d -r1.122 m68k.h
*** config/m68k/m68k.h 9 Nov 2004 10:13:09 -0000 1.122
--- config/m68k/m68k.h 30 Dec 2004 00:59:26 -0000
*************** extern enum reg_class regno_reg_class[];
*** 733,739 ****
/* On the m68k all args are always pushed. */
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
#define FUNCTION_PROFILER(FILE, LABELNO) \
asm_fprintf (FILE, "\tlea %LLP%d,%Ra0\n\tjsr mcount\n", (LABELNO))
--- 733,738 ----
Index: config/mcore/mcore-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mcore/mcore-protos.h,v
retrieving revision 1.18
diff -c -p -d -r1.18 mcore-protos.h
*** config/mcore/mcore-protos.h 19 Aug 2004 05:25:52 -0000 1.18
--- config/mcore/mcore-protos.h 30 Dec 2004 00:59:26 -0000
*************** extern int mcore_naked_function
*** 36,42 ****
#ifdef TREE_CODE
#ifdef HAVE_MACHINE_MODES
- extern int mcore_function_arg_partial_nregs (CUMULATIVE_ARGS, enum machine_mode, tree, int);
extern int mcore_num_arg_regs (enum machine_mode, tree);
#endif /* HAVE_MACHINE_MODES */
--- 36,41 ----
Index: config/mcore/mcore.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mcore/mcore.c,v
retrieving revision 1.75
diff -c -p -d -r1.75 mcore.c
*** config/mcore/mcore.c 9 Nov 2004 10:13:10 -0000 1.75
--- config/mcore/mcore.c 30 Dec 2004 00:59:26 -0000
*************** static int mcore_ior_cost
*** 149,154 ****
--- 149,157 ----
static bool mcore_rtx_costs (rtx, int, int, int *);
static void mcore_external_libcall (rtx);
static bool mcore_return_in_memory (tree, tree);
+ static int mcore_arg_partial_bytes (CUMULATIVE_ARGS *,
+ enum machine_mode,
+ tree, bool);
/* Initialize the GCC target structure. */
*************** static bool mcore_return_in_memory
*** 197,202 ****
--- 200,207 ----
#define TARGET_MUST_PASS_IN_STACK must_pass_in_stack_var_size
#undef TARGET_PASS_BY_REFERENCE
#define TARGET_PASS_BY_REFERENCE hook_pass_by_reference_must_pass_in_stack
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES mcore_arg_partial_bytes
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS mcore_setup_incoming_varargs
*************** mcore_function_arg (CUMULATIVE_ARGS cum,
*** 3107,3125 ****
return 0;
}
! /* Implements the FUNCTION_ARG_PARTIAL_NREGS macro.
! Returns the number of argument registers required to hold *part* of
! a parameter of machine mode MODE and type TYPE (which may be NULL if
the type is not known). If the argument fits entirely in the argument
registers, or entirely on the stack, then 0 is returned. CUM is the
number of argument registers already used by earlier parameters to
the function. */
! int
! mcore_function_arg_partial_nregs (CUMULATIVE_ARGS cum, enum machine_mode mode,
! tree type, int named)
{
! int reg = ROUND_REG (cum, mode);
if (named == 0)
return 0;
--- 3112,3129 ----
return 0;
}
! /* Returns the number of bytes of argument registers required to hold *part*
! of a parameter of machine mode MODE and type TYPE (which may be NULL if
the type is not known). If the argument fits entirely in the argument
registers, or entirely on the stack, then 0 is returned. CUM is the
number of argument registers already used by earlier parameters to
the function. */
! static int
! mcore_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type, bool named)
{
! int reg = ROUND_REG (*cum, mode);
if (named == 0)
return 0;
*************** mcore_function_arg_partial_nregs (CUMULA
*** 3148,3154 ****
reg = NPARM_REGS - reg;
/* Return partially in registers and partially on the stack. */
! return reg;
}
/* Return nonzero if SYMBOL is marked as being dllexport'd. */
--- 3152,3158 ----
reg = NPARM_REGS - reg;
/* Return partially in registers and partially on the stack. */
! return reg * UNITS_PER_WORD;
}
/* Return nonzero if SYMBOL is marked as being dllexport'd. */
Index: config/mcore/mcore.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mcore/mcore.h,v
retrieving revision 1.70
diff -c -p -d -r1.70 mcore.h
*** config/mcore/mcore.h 18 Aug 2004 17:05:08 -0000 1.70
--- config/mcore/mcore.h 30 Dec 2004 00:59:27 -0000
*************** extern const enum reg_class reg_class_fr
*** 704,717 ****
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
mcore_function_arg (CUM, MODE, TYPE, NAMED)
- /* For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
- For args passed entirely in registers or entirely in memory, zero.
- Any arg that starts in the first NPARM_REGS regs but won't entirely
- fit in them needs partial registers on the MCore. */
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- mcore_function_arg_partial_nregs (CUM, MODE, TYPE, NAMED)
-
/* Call the function profiler with a given profile label. */
#define FUNCTION_PROFILER(STREAM,LABELNO) \
{ \
--- 704,709 ----
Index: config/mips/mips-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips-protos.h,v
retrieving revision 1.81
diff -c -p -d -r1.81 mips-protos.h
*** config/mips/mips-protos.h 7 Dec 2004 22:40:40 -0000 1.81
--- config/mips/mips-protos.h 30 Dec 2004 00:59:27 -0000
*************** extern void function_arg_advance (CUMULA
*** 141,148 ****
tree, int);
extern struct rtx_def *function_arg (const CUMULATIVE_ARGS *,
enum machine_mode, tree, int);
- extern int function_arg_partial_nregs (const CUMULATIVE_ARGS *,
- enum machine_mode, tree, int);
extern int function_arg_boundary (enum machine_mode, tree);
extern bool mips_pad_arg_upward (enum machine_mode, tree);
extern bool mips_pad_reg_upward (enum machine_mode, tree);
--- 141,146 ----
Index: config/mips/mips.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.482
diff -c -p -d -r1.482 mips.c
*** config/mips/mips.c 15 Dec 2004 08:55:05 -0000 1.482
--- config/mips/mips.c 30 Dec 2004 00:59:28 -0000
*************** static bool mips_pass_by_reference (CUMU
*** 352,357 ****
--- 352,359 ----
tree, bool);
static bool mips_callee_copies (CUMULATIVE_ARGS *, enum machine_mode mode,
tree, bool);
+ static int mips_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode mode,
+ tree, bool);
static bool mips_valid_pointer_mode (enum machine_mode);
static bool mips_scalar_mode_supported_p (enum machine_mode);
static bool mips_vector_mode_supported_p (enum machine_mode);
*************** const struct mips_cpu_info mips_cpu_info
*** 798,803 ****
--- 800,807 ----
#define TARGET_PASS_BY_REFERENCE mips_pass_by_reference
#undef TARGET_CALLEE_COPIES
#define TARGET_CALLEE_COPIES mips_callee_copies
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES mips_arg_partial_bytes
#undef TARGET_VECTOR_MODE_SUPPORTED_P
#define TARGET_VECTOR_MODE_SUPPORTED_P mips_vector_mode_supported_p
*************** function_arg (const CUMULATIVE_ARGS *cum
*** 3316,3331 ****
}
! /* Implement FUNCTION_ARG_PARTIAL_NREGS. */
! int
! function_arg_partial_nregs (const CUMULATIVE_ARGS *cum,
! enum machine_mode mode, tree type, int named)
{
struct mips_arg_info info;
mips_arg_info (cum, mode, type, named, &info);
! return info.stack_words > 0 ? info.reg_words : 0;
}
--- 3320,3335 ----
}
! /* Implement TARGET_ARG_PARTIAL_BYTES. */
! static int
! mips_arg_partial_bytes (CUMULATIVE_ARGS *cum,
! enum machine_mode mode, tree type, bool named)
{
struct mips_arg_info info;
mips_arg_info (cum, mode, type, named, &info);
! return info.stack_words > 0 ? info.reg_words * UNITS_PER_WORD : 0;
}
Index: config/mips/mips.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.h,v
retrieving revision 1.378
diff -c -p -d -r1.378 mips.h
*** config/mips/mips.h 23 Dec 2004 19:39:31 -0000 1.378
--- config/mips/mips.h 30 Dec 2004 00:59:29 -0000
*************** typedef struct mips_args {
*** 2279,2291 ****
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg( &CUM, MODE, TYPE, NAMED)
- /* For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
- For args passed entirely in registers or entirely in memory, zero. */
-
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)
-
#define FUNCTION_ARG_BOUNDARY function_arg_boundary
#define FUNCTION_ARG_PADDING(MODE, TYPE) \
--- 2279,2284 ----
Index: config/mn10300/mn10300-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mn10300/mn10300-protos.h,v
retrieving revision 1.14
diff -c -p -d -r1.14 mn10300-protos.h
*** config/mn10300/mn10300-protos.h 9 Jul 2004 09:50:10 -0000 1.14
--- config/mn10300/mn10300-protos.h 30 Dec 2004 00:59:29 -0000
*************** extern bool mn10300_wide_const_load_uses
*** 50,57 ****
#ifdef TREE_CODE
extern struct rtx_def *function_arg (CUMULATIVE_ARGS *,
enum machine_mode, tree, int);
- extern int function_arg_partial_nregs (CUMULATIVE_ARGS *,
- enum machine_mode, tree, int);
#endif /* TREE_CODE */
extern void expand_prologue (void);
--- 50,55 ----
Index: config/mn10300/mn10300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mn10300/mn10300.c,v
retrieving revision 1.75
diff -c -p -d -r1.75 mn10300.c
*** config/mn10300/mn10300.c 10 Dec 2004 14:03:45 -0000 1.75
--- config/mn10300/mn10300.c 30 Dec 2004 00:59:29 -0000
*************** static bool mn10300_return_in_memory (tr
*** 73,78 ****
--- 73,80 ----
static rtx mn10300_builtin_saveregs (void);
static bool mn10300_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
+ static int mn10300_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, bool);
/* Initialize the GCC target structure. */
#undef TARGET_ASM_ALIGNED_HI_OP
*************** static bool mn10300_pass_by_reference (C
*** 99,104 ****
--- 101,108 ----
#define TARGET_PASS_BY_REFERENCE mn10300_pass_by_reference
#undef TARGET_CALLEE_COPIES
#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES mn10300_arg_partial_bytes
#undef TARGET_EXPAND_BUILTIN_SAVEREGS
#define TARGET_EXPAND_BUILTIN_SAVEREGS mn10300_builtin_saveregs
*************** function_arg (CUMULATIVE_ARGS *cum, enum
*** 1528,1539 ****
return result;
}
! /* Return the number of registers to use for an argument passed partially
! in registers and partially in memory. */
! int
! function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type, int named ATTRIBUTE_UNUSED)
{
int size, align;
--- 1532,1543 ----
return result;
}
! /* Return the number of bytes of registers to use for an argument passed
! partially in registers and partially in memory. */
! static int
! mn10300_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type, bool named ATTRIBUTE_UNUSED)
{
int size, align;
*************** function_arg_partial_nregs (CUMULATIVE_A
*** 1565,1571 ****
&& cum->nbytes + size > nregs * UNITS_PER_WORD)
return 0;
! return (nregs * UNITS_PER_WORD - cum->nbytes) / UNITS_PER_WORD;
}
/* Output a tst insn. */
--- 1569,1575 ----
&& cum->nbytes + size > nregs * UNITS_PER_WORD)
return 0;
! return nregs * UNITS_PER_WORD - cum->nbytes;
}
/* Output a tst insn. */
Index: config/mn10300/mn10300.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mn10300/mn10300.h,v
retrieving revision 1.84
diff -c -p -d -r1.84 mn10300.h
*** config/mn10300/mn10300.h 29 Oct 2004 07:15:10 -0000 1.84
--- config/mn10300/mn10300.h 30 Dec 2004 00:59:30 -0000
*************** struct cum_arg {int nbytes; };
*** 609,617 ****
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&CUM, MODE, TYPE, NAMED)
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)
-
/* Define how to find the value returned by a function.
VALTYPE is the data type of the value (as a tree).
If the precise function being called is known, FUNC is its FUNCTION_DECL;
--- 609,614 ----
Index: config/ns32k/ns32k.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ns32k/ns32k.c,v
retrieving revision 1.49
diff -c -p -d -r1.49 ns32k.c
*** config/ns32k/ns32k.c 9 Nov 2004 10:13:17 -0000 1.49
--- config/ns32k/ns32k.c 30 Dec 2004 00:59:30 -0000
*************** static void ns32k_output_function_epilog
*** 74,79 ****
--- 74,81 ----
static bool ns32k_rtx_costs (rtx, int, int, int *);
static int ns32k_address_cost (rtx);
static rtx ns32k_struct_value_rtx (tree, int);
+ static int ns32k_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, bool);
/* Initialize the GCC target structure. */
#undef TARGET_ATTRIBUTE_TABLE
*************** static rtx ns32k_struct_value_rtx (tree,
*** 100,105 ****
--- 102,110 ----
#undef TARGET_STRUCT_VALUE_RTX
#define TARGET_STRUCT_VALUE_RTX ns32k_struct_value_rtx
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES ns32k_arg_partial_bytes
+
#undef TARGET_ASM_FILE_START_APP_OFF
#define TARGET_ASM_FILE_START_APP_OFF true
*************** ns32k_notice_update_cc (rtx exp, rtx ins
*** 1639,1641 ****
--- 1644,1670 ----
&& reg_overlap_mentioned_p (cc_status.value1, cc_status.value2))
abort ();
}
+
+ /* Implement TARGET_ARG_PARTIAL_BYTES. */
+
+ static int
+ ns32k_arg_partial_bytes (CUMULATIVE_ARGS *pcum, enum machine_mode mode,
+ tree type, bool named ATTRIBUTE_UNUSED)
+ {
+ int cum = *pcum;
+
+ if (TARGET_REGPARM && cum < 8)
+ {
+ HOST_WIDE_INT size;
+
+ if (mode == BLKmode)
+ size = int_size_in_bytes (type);
+ else
+ size = GET_MODE_SIZE (mode);
+
+ if (8 < cum + size)
+ return 8 - cum;
+ }
+
+ return 0;
+ }
Index: config/ns32k/ns32k.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ns32k/ns32k.h,v
retrieving revision 1.70
diff -c -p -d -r1.70 ns32k.h
*** config/ns32k/ns32k.h 1 Sep 2004 19:41:40 -0000 1.70
--- config/ns32k/ns32k.h 30 Dec 2004 00:59:30 -0000
*************** enum reg_class
*** 708,724 ****
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
((TARGET_REGPARM && (CUM) < 8) ? gen_rtx_REG ((MODE), (CUM) / 4) : 0)
- /* For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
- For args passed entirely in registers or entirely in memory, zero. */
-
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- ((TARGET_REGPARM && (CUM) < 8 \
- && 8 < ((CUM) + ((MODE) == BLKmode \
- ? int_size_in_bytes (TYPE) \
- : GET_MODE_SIZE (MODE)))) \
- ? 2 - (CUM) / 4 : 0)
-
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry.
--- 708,713 ----
Index: config/pa/pa-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa-protos.h,v
retrieving revision 1.37
diff -c -p -d -r1.37 pa-protos.h
*** config/pa/pa-protos.h 20 Aug 2004 15:11:41 -0000 1.37
--- config/pa/pa-protos.h 30 Dec 2004 00:59:30 -0000
*************** extern rtx function_arg (CUMULATIVE_ARGS
*** 160,168 ****
tree, int);
extern rtx function_value (tree, tree);
#endif
- extern int function_arg_partial_nregs (CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int);
extern bool pa_return_in_memory (tree, tree);
#endif /* TREE_CODE */
--- 160,165 ----
Index: config/pa/pa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa.c,v
retrieving revision 1.281
diff -c -p -d -r1.281 pa.c
*** config/pa/pa.c 27 Dec 2004 01:08:09 -0000 1.281
--- config/pa/pa.c 30 Dec 2004 00:59:32 -0000
*************** static void output_deferred_plabels (voi
*** 141,148 ****
static void pa_hpux_init_libfuncs (void);
#endif
static rtx pa_struct_value_rtx (tree, int);
! static bool pa_pass_by_reference (CUMULATIVE_ARGS *ca, enum machine_mode,
tree, bool);
static struct machine_function * pa_init_machine_status (void);
--- 141,150 ----
static void pa_hpux_init_libfuncs (void);
#endif
static rtx pa_struct_value_rtx (tree, int);
! static bool pa_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
+ static int pa_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, bool);
static struct machine_function * pa_init_machine_status (void);
*************** static size_t n_deferred_plabels = 0;
*** 282,287 ****
--- 284,291 ----
#define TARGET_PASS_BY_REFERENCE pa_pass_by_reference
#undef TARGET_CALLEE_COPIES
#define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES pa_arg_partial_bytes
#undef TARGET_EXPAND_BUILTIN_SAVEREGS
#define TARGET_EXPAND_BUILTIN_SAVEREGS hppa_builtin_saveregs
*************** function_arg (CUMULATIVE_ARGS *cum, enum
*** 9069,9075 ****
arg_size = FUNCTION_ARG_SIZE (mode, type);
/* If this arg would be passed partially or totally on the stack, then
! this routine should return zero. FUNCTION_ARG_PARTIAL_NREGS will
handle arguments which are split between regs and stack slots if
the ABI mandates split arguments. */
if (! TARGET_64BIT)
--- 9073,9079 ----
arg_size = FUNCTION_ARG_SIZE (mode, type);
/* If this arg would be passed partially or totally on the stack, then
! this routine should return zero. pa_arg_partial_bytes will
handle arguments which are split between regs and stack slots if
the ABI mandates split arguments. */
if (! TARGET_64BIT)
*************** function_arg (CUMULATIVE_ARGS *cum, enum
*** 9238,9252 ****
/* If this arg would be passed totally in registers or totally on the stack,
! then this routine should return zero. It is currently called only for
! the 64-bit target. */
! int
! function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type, int named ATTRIBUTE_UNUSED)
{
unsigned int max_arg_words = 8;
unsigned int offset = 0;
if (FUNCTION_ARG_SIZE (mode, type) > 1 && (cum->words & 1))
offset = 1;
--- 9242,9259 ----
/* If this arg would be passed totally in registers or totally on the stack,
! then this routine should return zero. */
!
! static int
! pa_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type, bool named ATTRIBUTE_UNUSED)
{
unsigned int max_arg_words = 8;
unsigned int offset = 0;
+ if (!TARGET_64BIT)
+ return 0;
+
if (FUNCTION_ARG_SIZE (mode, type) > 1 && (cum->words & 1))
offset = 1;
*************** function_arg_partial_nregs (CUMULATIVE_A
*** 9258,9264 ****
return 0;
else
/* Arg is split. */
! return max_arg_words - cum->words - offset;
}
--- 9265,9271 ----
return 0;
else
/* Arg is split. */
! return (max_arg_words - cum->words - offset) * UNITS_PER_WORD;
}
Index: config/pa/pa.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa.h,v
retrieving revision 1.238
diff -c -p -d -r1.238 pa.h
*** config/pa/pa.h 14 Dec 2004 22:35:48 -0000 1.238
--- config/pa/pa.h 30 Dec 2004 00:59:32 -0000
*************** struct hppa_args {int words, nargs_proto
*** 923,937 ****
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&CUM, MODE, TYPE, NAMED)
- /* For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
- For args passed entirely in registers or entirely in memory, zero. */
-
- /* For PA32 there are never split arguments. PA64, on the other hand, can
- pass arguments partially in registers and partially in memory. */
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- (TARGET_64BIT ? function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED) : 0)
-
/* If defined, a C expression that gives the alignment boundary, in
bits, of an argument with the specified mode and type. If it is
not defined, `PARM_BOUNDARY' is used for all arguments. */
--- 923,928 ----
Index: config/pdp11/pdp11.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pdp11/pdp11.h,v
retrieving revision 1.62
diff -c -p -d -r1.62 pdp11.h
*** config/pdp11/pdp11.h 24 Nov 2004 19:45:12 -0000 1.62
--- config/pdp11/pdp11.h 30 Dec 2004 00:59:32 -0000
*************** maybe ac0 ? - as option someday! */
*** 628,639 ****
FUNCTION_ARG (CUM, MODE, TYPE, NAMED)
*/
- /* For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
- For args passed entirely in registers or entirely in memory, zero. */
-
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
-
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */
--- 628,633 ----
Index: config/rs6000/rs6000-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000-protos.h,v
retrieving revision 1.91
diff -c -p -d -r1.91 rs6000-protos.h
*** config/rs6000/rs6000-protos.h 14 Nov 2004 20:28:56 -0000 1.91
--- config/rs6000/rs6000-protos.h 30 Dec 2004 00:59:33 -0000
*************** extern void function_arg_advance (CUMULA
*** 160,167 ****
extern int function_arg_boundary (enum machine_mode, tree);
extern struct rtx_def *function_arg (CUMULATIVE_ARGS *,
enum machine_mode, tree, int);
- extern int function_arg_partial_nregs (CUMULATIVE_ARGS *,
- enum machine_mode, tree, int);
extern rtx rs6000_function_value (tree, tree);
extern rtx rs6000_libcall_value (enum machine_mode);
extern struct rtx_def *rs6000_va_arg (tree, tree);
--- 160,165 ----
Index: config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.771
diff -c -p -d -r1.771 rs6000.c
*** config/rs6000/rs6000.c 28 Dec 2004 11:24:21 -0000 1.771
--- config/rs6000/rs6000.c 30 Dec 2004 00:59:36 -0000
*************** static void setup_incoming_varargs (CUMU
*** 756,761 ****
--- 756,763 ----
int *, int);
static bool rs6000_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
+ static int rs6000_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, bool);
#if TARGET_MACHO
static void macho_branch_islands (void);
static void add_compiler_branch_island (tree, tree, int);
*************** static const char alt_reg_names[][8] =
*** 991,996 ****
--- 993,1000 ----
#define TARGET_MUST_PASS_IN_STACK rs6000_must_pass_in_stack
#undef TARGET_PASS_BY_REFERENCE
#define TARGET_PASS_BY_REFERENCE rs6000_pass_by_reference
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES rs6000_arg_partial_bytes
#undef TARGET_BUILD_BUILTIN_VA_LIST
#define TARGET_BUILD_BUILTIN_VA_LIST rs6000_build_builtin_va_list
*************** rs6000_mixed_function_arg (enum machine_
*** 5306,5311 ****
--- 5310,5317 ----
In any case, the code to store the whole arg to memory is often
more efficient than code to store pieces, and we know that space
is available in the right place for the whole arg. */
+ /* FIXME: This should be fixed since the conversion to
+ TARGET_ARG_PARTIAL_BYTES. */
rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, NULL_RTX, const0_rtx);
i = 0;
*************** function_arg (CUMULATIVE_ARGS *cum, enum
*** 5606,5616 ****
the number of registers used. For args passed entirely in registers
or entirely in memory, zero. When an arg is described by a PARALLEL,
perhaps using more than one register type, this function returns the
! number of registers used by the first element of the PARALLEL. */
! int
! function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type, int named)
{
int ret = 0;
int align;
--- 5612,5622 ----
the number of registers used. For args passed entirely in registers
or entirely in memory, zero. When an arg is described by a PARALLEL,
perhaps using more than one register type, this function returns the
! number of bytes of registers used by the PARALLEL. */
! static int
! rs6000_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type, bool named)
{
int ret = 0;
int align;
*************** function_arg_partial_nregs (CUMULATIVE_A
*** 5648,5655 ****
&& GP_ARG_NUM_REG < align_words + rs6000_arg_size (mode, type))
ret = GP_ARG_NUM_REG - align_words;
if (ret != 0 && TARGET_DEBUG_ARG)
! fprintf (stderr, "function_arg_partial_nregs: %d\n", ret);
return ret;
}
--- 5654,5663 ----
&& GP_ARG_NUM_REG < align_words + rs6000_arg_size (mode, type))
ret = GP_ARG_NUM_REG - align_words;
+ ret *= (TARGET_32BIT ? 4 : 8);
+
if (ret != 0 && TARGET_DEBUG_ARG)
! fprintf (stderr, "rs6000_arg_partial_bytes: %d\n", ret);
return ret;
}
Index: config/rs6000/rs6000.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.h,v
retrieving revision 1.349
diff -c -p -d -r1.349 rs6000.h
*** config/rs6000/rs6000.h 11 Dec 2004 17:37:25 -0000 1.349
--- config/rs6000/rs6000.h 30 Dec 2004 00:59:36 -0000
*************** typedef struct rs6000_args
*** 1744,1756 ****
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&CUM, MODE, TYPE, NAMED)
- /* For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
- For args passed entirely in registers or entirely in memory, zero. */
-
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)
-
/* If defined, a C expression which determines whether, and in which
direction, to pad out an argument with extra space. The value
should be of type `enum direction': either `upward' to pad above
--- 1744,1749 ----
Index: config/s390/s390.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.h,v
retrieving revision 1.130
diff -c -p -d -r1.130 s390.h
*** config/s390/s390.h 23 Nov 2004 17:39:58 -0000 1.130
--- config/s390/s390.h 30 Dec 2004 00:59:37 -0000
*************** CUMULATIVE_ARGS;
*** 717,724 ****
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
s390_function_arg (&CUM, MODE, TYPE, NAMED)
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
-
/* Arguments can be placed in general registers 2 to 6,
or in floating point registers 0 and 2. */
#define FUNCTION_ARG_REGNO_P(N) (((N) >=2 && (N) <7) || \
--- 717,722 ----
Index: config/sh/sh.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.c,v
retrieving revision 1.314
diff -c -p -d -r1.314 sh.c
*** config/sh/sh.c 26 Nov 2004 01:56:36 -0000 1.314
--- config/sh/sh.c 30 Dec 2004 00:59:38 -0000
*************** static bool sh_pass_by_reference (CUMULA
*** 286,291 ****
--- 286,293 ----
tree, bool);
static bool sh_callee_copies (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
+ static int sh_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, bool);
static int sh_dwarf_calling_convention (tree);
*************** static int sh_dwarf_calling_convention (
*** 444,449 ****
--- 446,453 ----
#define TARGET_PASS_BY_REFERENCE sh_pass_by_reference
#undef TARGET_CALLEE_COPIES
#define TARGET_CALLEE_COPIES sh_callee_copies
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES sh_arg_partial_bytes
#undef TARGET_BUILD_BUILTIN_VA_LIST
#define TARGET_BUILD_BUILTIN_VA_LIST sh_build_builtin_va_list
*************** sh_callee_copies (CUMULATIVE_ARGS *cum,
*** 6668,6673 ****
--- 6672,6701 ----
% SH_MIN_ALIGN_FOR_CALLEE_COPY == 0));
}
+ static int
+ sh_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, bool named ATTRIBUTE_UNUSED)
+ {
+ int words = 0;
+
+ if (!TARGET_SH5
+ && PASS_IN_REG_P (*cum, mode, type)
+ && !(TARGET_SH4 || TARGET_SH2A_DOUBLE)
+ && (ROUND_REG (*cum, mode)
+ + (mode != BLKmode
+ ? ROUND_ADVANCE (GET_MODE_SIZE (mode))
+ : ROUND_ADVANCE (int_size_in_bytes (type)))
+ > NPARM_REGS (mode)))
+ words = NPARM_REGS (mode) - ROUND_REG (*cum, mode);
+
+ else if (!TARGET_SHCOMPACT
+ && SH5_WOULD_BE_PARTIAL_NREGS (*cum, mode, type, named))
+ words = NPARM_REGS (SImode) - cum->arg_count[SH_ARG_INT];
+
+ return words * UNITS_PER_WORD;
+ }
+
+
/* Define where to put the arguments to a function.
Value is zero to push the argument on the stack,
or a hard register in which to store the argument.
Index: config/sh/sh.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.h,v
retrieving revision 1.260
diff -c -p -d -r1.260 sh.h
*** config/sh/sh.h 28 Sep 2004 17:37:35 -0000 1.260
--- config/sh/sh.h 30 Dec 2004 00:59:39 -0000
*************** struct sh_args {
*** 2204,2230 ****
(REG)), \
const0_rtx))))
- /* For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
- For args passed entirely in registers or entirely in memory, zero.
-
- We sometimes split args. */
-
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- ((! TARGET_SH5 \
- && PASS_IN_REG_P ((CUM), (MODE), (TYPE)) \
- && ! (TARGET_SH4 || TARGET_SH2A_DOUBLE) \
- && (ROUND_REG ((CUM), (MODE)) \
- + ((MODE) != BLKmode \
- ? ROUND_ADVANCE (GET_MODE_SIZE (MODE)) \
- : ROUND_ADVANCE (int_size_in_bytes (TYPE))) \
- > NPARM_REGS (MODE))) \
- ? NPARM_REGS (MODE) - ROUND_REG ((CUM), (MODE)) \
- : (SH5_WOULD_BE_PARTIAL_NREGS ((CUM), (MODE), (TYPE), (NAMED)) \
- && ! TARGET_SHCOMPACT) \
- ? NPARM_REGS (SImode) - (CUM).arg_count[(int) SH_ARG_INT] \
- : 0)
-
#define SH5_WOULD_BE_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
(TARGET_SH5 \
&& ((MODE) == BLKmode || (MODE) == TImode || (MODE) == CDImode \
--- 2204,2209 ----
Index: config/sparc/sparc-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc-protos.h,v
retrieving revision 1.49
diff -c -p -d -r1.49 sparc-protos.h
*** config/sparc/sparc-protos.h 28 Sep 2004 06:26:08 -0000 1.49
--- config/sparc/sparc-protos.h 30 Dec 2004 00:59:39 -0000
*************** extern void function_arg_advance (CUMULA
*** 30,37 ****
enum machine_mode, tree, int);
extern struct rtx_def *function_arg (const CUMULATIVE_ARGS *,
enum machine_mode, tree, int, int);
- extern int function_arg_partial_nregs (const CUMULATIVE_ARGS *,
- enum machine_mode, tree, int);
#ifdef RTX_CODE
extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree);
extern void sparc_va_start (tree, rtx);
--- 30,35 ----
Index: config/sparc/sparc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.c,v
retrieving revision 1.350
diff -c -p -d -r1.350 sparc.c
*** config/sparc/sparc.c 30 Dec 2004 00:42:16 -0000 1.350
--- config/sparc/sparc.c 30 Dec 2004 00:59:41 -0000
*************** static tree sparc_gimplify_va_arg (tree,
*** 356,361 ****
--- 356,363 ----
static bool sparc_vector_mode_supported_p (enum machine_mode);
static bool sparc_pass_by_reference (CUMULATIVE_ARGS *,
enum machine_mode, tree, bool);
+ static int sparc_arg_partial_bytes (CUMULATIVE_ARGS *,
+ enum machine_mode, tree, bool);
static void sparc_dwarf_handle_frame_unspec (const char *, rtx, int);
#ifdef SUBTARGET_ATTRIBUTE_TABLE
const struct attribute_spec sparc_attribute_table[];
*************** enum processor_type sparc_cpu;
*** 469,474 ****
--- 471,478 ----
#define TARGET_MUST_PASS_IN_STACK must_pass_in_stack_var_size
#undef TARGET_PASS_BY_REFERENCE
#define TARGET_PASS_BY_REFERENCE sparc_pass_by_reference
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES sparc_arg_partial_bytes
#undef TARGET_EXPAND_BUILTIN_SAVEREGS
#define TARGET_EXPAND_BUILTIN_SAVEREGS sparc_builtin_saveregs
*************** function_arg_record_value (tree type, en
*** 5618,5624 ****
/* If at least one field must be passed on the stack, generate
(parallel [(expr_list (nil) ...) ...]) so that all fields will
also be passed on the stack. We can't do much better because the
! semantics of FUNCTION_ARG_PARTIAL_NREGS doesn't handle the case
of structures for which the fields passed exclusively in registers
are not at the beginning of the structure. */
if (parms.stack)
--- 5622,5628 ----
/* If at least one field must be passed on the stack, generate
(parallel [(expr_list (nil) ...) ...]) so that all fields will
also be passed on the stack. We can't do much better because the
! semantics of TARGET_ARG_PARTIAL_BYTES doesn't handle the case
of structures for which the fields passed exclusively in registers
are not at the beginning of the structure. */
if (parms.stack)
*************** function_arg (const struct sparc_args *c
*** 5857,5865 ****
return reg;
}
! /* Handle the FUNCTION_ARG_PARTIAL_NREGS macro.
! For an arg passed partly in registers and partly in memory,
! this is the number of registers used.
For args passed entirely in registers or entirely in memory, zero.
Any arg that starts in the first 6 regs but won't entirely fit in them
--- 5861,5868 ----
return reg;
}
! /* For an arg passed partly in registers and partly in memory,
! this is the number of bytes of registers used.
For args passed entirely in registers or entirely in memory, zero.
Any arg that starts in the first 6 regs but won't entirely fit in them
*************** function_arg (const struct sparc_args *c
*** 5868,5876 ****
values that begin in the last fp reg [where "last fp reg" varies with the
mode] will be split between that reg and memory. */
! int
! function_arg_partial_nregs (const struct sparc_args *cum,
! enum machine_mode mode, tree type, int named)
{
int slotno, regno, padding;
--- 5871,5879 ----
values that begin in the last fp reg [where "last fp reg" varies with the
mode] will be split between that reg and memory. */
! static int
! sparc_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
! tree type, bool named)
{
int slotno, regno, padding;
*************** function_arg_partial_nregs (const struct
*** 5886,5898 ****
? ROUND_ADVANCE (int_size_in_bytes (type))
: ROUND_ADVANCE (GET_MODE_SIZE (mode))))
> SPARC_INT_ARG_MAX)
! return SPARC_INT_ARG_MAX - slotno;
}
else
{
/* We are guaranteed by pass_by_reference that the size of the
! argument is not greater than 16 bytes, so we only need to
! return 1 if the argument is partially passed in registers. */
if (type && AGGREGATE_TYPE_P (type))
{
--- 5889,5901 ----
? ROUND_ADVANCE (int_size_in_bytes (type))
: ROUND_ADVANCE (GET_MODE_SIZE (mode))))
> SPARC_INT_ARG_MAX)
! return (SPARC_INT_ARG_MAX - slotno) * UNITS_PER_WORD;
}
else
{
/* We are guaranteed by pass_by_reference that the size of the
! argument is not greater than 16 bytes, so we only need to return
! one word if the argument is partially passed in registers. */
if (type && AGGREGATE_TYPE_P (type))
{
*************** function_arg_partial_nregs (const struct
*** 5900,5906 ****
if (size > UNITS_PER_WORD
&& slotno == SPARC_INT_ARG_MAX - 1)
! return 1;
}
else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT
|| (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
--- 5903,5909 ----
if (size > UNITS_PER_WORD
&& slotno == SPARC_INT_ARG_MAX - 1)
! return UNITS_PER_WORD;
}
else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT
|| (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
*************** function_arg_partial_nregs (const struct
*** 5909,5921 ****
/* The complex types are passed as packed types. */
if (GET_MODE_SIZE (mode) > UNITS_PER_WORD
&& slotno == SPARC_INT_ARG_MAX - 1)
! return 1;
}
else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
{
if ((slotno + GET_MODE_SIZE (mode) / UNITS_PER_WORD)
> SPARC_FP_ARG_MAX)
! return 1;
}
}
--- 5912,5924 ----
/* The complex types are passed as packed types. */
if (GET_MODE_SIZE (mode) > UNITS_PER_WORD
&& slotno == SPARC_INT_ARG_MAX - 1)
! return UNITS_PER_WORD;
}
else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
{
if ((slotno + GET_MODE_SIZE (mode) / UNITS_PER_WORD)
> SPARC_FP_ARG_MAX)
! return UNITS_PER_WORD;
}
}
Index: config/sparc/sparc.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.h,v
retrieving revision 1.269
diff -c -p -d -r1.269 sparc.h
*** config/sparc/sparc.h 9 Nov 2004 17:06:03 -0000 1.269
--- config/sparc/sparc.h 30 Dec 2004 00:59:41 -0000
*************** function_arg (& (CUM), (MODE), (TYPE), (
*** 1737,1749 ****
#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (& (CUM), (MODE), (TYPE), (NAMED), 1)
- /* For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
- For args passed entirely in registers or entirely in memory, zero. */
-
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- function_arg_partial_nregs (& (CUM), (MODE), (TYPE), (NAMED))
-
/* If defined, a C expression which determines whether, and in which direction,
to pad out an argument with extra space. The value should be of type
`enum direction': either `upward' to pad above the argument,
--- 1737,1742 ----
Index: config/stormy16/stormy16.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/stormy16/stormy16.h,v
retrieving revision 1.93
diff -c -p -d -r1.93 stormy16.h
*** config/stormy16/stormy16.h 15 Nov 2004 13:19:50 -0000 1.93
--- config/stormy16/stormy16.h 30 Dec 2004 00:59:41 -0000
*************** enum reg_class
*** 417,424 ****
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
xstormy16_function_arg (CUM, MODE, TYPE, NAMED)
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) 0
-
/* For this platform, the value of CUMULATIVE_ARGS is the number of words
of arguments that have been passed in registers so far. */
#define CUMULATIVE_ARGS int
--- 417,422 ----
Index: config/v850/v850-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/v850/v850-protos.h,v
retrieving revision 1.23
diff -c -p -d -r1.23 v850-protos.h
*** config/v850/v850-protos.h 17 Oct 2004 18:09:48 -0000 1.23
--- config/v850/v850-protos.h 30 Dec 2004 00:59:41 -0000
*************** extern void v850_output_aligned_bss
*** 80,88 ****
extern void v850_output_common (FILE *, tree, const char *, int, int);
extern void v850_output_local (FILE *, tree, const char *, int, int);
extern v850_data_area v850_get_data_area (tree);
- #ifdef HAVE_MACHINE_MODES
- extern int function_arg_partial_nregs (CUMULATIVE_ARGS *, Mmode, tree, int);
- #endif
#endif
extern void ghs_pragma_section (struct cpp_reader *);
--- 80,85 ----
Index: config/v850/v850.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/v850/v850.c,v
retrieving revision 1.96
diff -c -p -d -r1.96 v850.c
*** config/v850/v850.c 9 Nov 2004 10:13:29 -0000 1.96
--- config/v850/v850.c 30 Dec 2004 00:59:42 -0000
*************** static void v850_setup_incoming_varargs
*** 69,74 ****
--- 69,76 ----
tree, int *, int);
static bool v850_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
+ static int v850_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, bool);
/* Information about the various small memory areas. */
struct small_memory_info small_memory[ (int)SMALL_MEMORY_max ] =
*************** static int v850_interrupt_p = FALSE;
*** 137,142 ****
--- 139,147 ----
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS v850_setup_incoming_varargs
+ #undef TARGET_ARG_PARTIAL_BYTES
+ #define TARGET_ARG_PARTIAL_BYTES v850_arg_partial_bytes
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Sometimes certain combinations of command options do not make
*************** function_arg (CUMULATIVE_ARGS * cum,
*** 257,270 ****
}
! /* Return the number of words which must be put into registers
for values which are part in registers and part in memory. */
! int
! function_arg_partial_nregs (CUMULATIVE_ARGS * cum,
! enum machine_mode mode,
! tree type,
! int named)
{
int size, align;
--- 262,273 ----
}
! /* Return the number of bytes which must be put into registers
for values which are part in registers and part in memory. */
! static int
! v850_arg_partial_bytes (CUMULATIVE_ARGS * cum, enum machine_mode mode,
! tree type, bool named)
{
int size, align;
*************** function_arg_partial_nregs (CUMULATIVE_A
*** 293,299 ****
&& cum->nbytes + size > 4 * UNITS_PER_WORD)
return 0;
! return (4 * UNITS_PER_WORD - cum->nbytes) / UNITS_PER_WORD;
}
--- 296,302 ----
&& cum->nbytes + size > 4 * UNITS_PER_WORD)
return 0;
! return 4 * UNITS_PER_WORD - cum->nbytes;
}
Index: config/v850/v850.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/v850/v850.h,v
retrieving revision 1.99
diff -c -p -d -r1.99 v850.h
*** config/v850/v850.h 29 Nov 2004 20:46:12 -0000 1.99
--- config/v850/v850.h 30 Dec 2004 00:59:42 -0000
*************** struct cum_arg { int nbytes; int anonymo
*** 746,754 ****
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&CUM, MODE, TYPE, NAMED)
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)
-
/* Initialize a variable CUM of type CUMULATIVE_ARGS
for a call to a function whose data type is FNTYPE.
For a library call, FNTYPE is 0. */
--- 746,751 ----
Index: config/xtensa/xtensa.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/xtensa/xtensa.h,v
retrieving revision 1.59
diff -c -p -d -r1.59 xtensa.h
*** config/xtensa/xtensa.h 26 Nov 2004 03:39:20 -0000 1.59
--- config/xtensa/xtensa.h 30 Dec 2004 00:59:43 -0000
*************** typedef struct xtensa_args
*** 762,770 ****
#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&CUM, MODE, TYPE, TRUE)
- /* Arguments are never passed partly in memory and partly in registers. */
- #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) (0)
-
/* Specify function argument alignment. */
#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
((TYPE) != 0 \
--- 762,767 ----
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.408
diff -c -p -d -r1.408 tm.texi
*** doc/tm.texi 28 Dec 2004 04:36:32 -0000 1.408
--- doc/tm.texi 30 Dec 2004 00:59:45 -0000
*************** If @code{FUNCTION_INCOMING_ARG} is not d
*** 3748,3772 ****
serves both purposes.
@end defmac
! @defmac FUNCTION_ARG_PARTIAL_NREGS (@var{cum}, @var{mode}, @var{type}, @var{named})
! A C expression for the number of words, at the beginning of an
! argument, that must be put in registers. The value must be zero for
arguments that are passed entirely in registers or that are entirely
pushed on the stack.
On some machines, certain arguments must be passed partially in
registers and partially in memory. On these machines, typically the
! first @var{n} words of arguments are passed in registers, and the rest
on the stack. If a multi-word argument (a @code{double} or a
structure) crosses that boundary, its first few words must be passed
in registers and the rest must be pushed. This macro tells the
! compiler when this occurs, and how many of the words should go in
! registers.
@code{FUNCTION_ARG} for these arguments should return the first
register to be used by the caller for this argument; likewise
@code{FUNCTION_INCOMING_ARG}, for the called function.
! @end defmac
@deftypefn {Target Hook} bool TARGET_PASS_BY_REFERENCE (CUMULATIVE_ARGS *@var{cum}, enum machine_mode @var{mode}, tree @var{type}, bool @var{named})
This target hook should return @code{true} if an argument at the
--- 3748,3771 ----
serves both purposes.
@end defmac
! @deftypefn {Target Hook} int TARGET_ARG_PARTIAL_BYTES (CUMULATIVE_ARGS *@var{cum}, enum machine_mode @var{mode}, tree @var{type}, bool @var{named})
! This target hook returns the number of bytes at the beginning of an
! argument that must be put in registers. The value must be zero for
arguments that are passed entirely in registers or that are entirely
pushed on the stack.
On some machines, certain arguments must be passed partially in
registers and partially in memory. On these machines, typically the
! first few words of arguments are passed in registers, and the rest
on the stack. If a multi-word argument (a @code{double} or a
structure) crosses that boundary, its first few words must be passed
in registers and the rest must be pushed. This macro tells the
! compiler when this occurs, and how many bytes should go in registers.
@code{FUNCTION_ARG} for these arguments should return the first
register to be used by the caller for this argument; likewise
@code{FUNCTION_INCOMING_ARG}, for the called function.
! @end deftypefn
@deftypefn {Target Hook} bool TARGET_PASS_BY_REFERENCE (CUMULATIVE_ARGS *@var{cum}, enum machine_mode @var{mode}, tree @var{type}, bool @var{named})
This target hook should return @code{true} if an argument at the