mirror of git://gcc.gnu.org/git/gcc.git
m32c.c (m32c_function_arg): Structures are always passed on the stack.
* config/m32c/m32c.c (m32c_function_arg): Structures are always passed on the stack. (m32c_init_cumulative_args): When a function returns a structure, always pass the pointer to that return area on the stack. (m32c_function_arg_advance): Don't increment the parameter number if we're processing the returned structure pointer. (pushm_info): Reverse order of registers. From-SVN: r112765
This commit is contained in:
parent
ff5e9a942c
commit
9d746d5e11
|
@ -1,3 +1,13 @@
|
||||||
|
2006-04-07 DJ Delorie <dj@redhat.com>
|
||||||
|
|
||||||
|
* config/m32c/m32c.c (m32c_function_arg): Structures are always
|
||||||
|
passed on the stack.
|
||||||
|
(m32c_init_cumulative_args): When a function returns a structure,
|
||||||
|
always pass the pointer to that return area on the stack.
|
||||||
|
(m32c_function_arg_advance): Don't increment the parameter number
|
||||||
|
if we're processing the returned structure pointer.
|
||||||
|
(pushm_info): Reverse order of registers.
|
||||||
|
|
||||||
2006-04-07 Sebastian Pop <pop@cri.ensmp.fr>
|
2006-04-07 Sebastian Pop <pop@cri.ensmp.fr>
|
||||||
|
|
||||||
* tree-ssa-loop-niter.c (inverse, number_of_iterations_ne,
|
* tree-ssa-loop-niter.c (inverse, number_of_iterations_ne,
|
||||||
|
|
|
@ -1204,15 +1204,15 @@ static struct
|
||||||
int a24_bytes;
|
int a24_bytes;
|
||||||
} pushm_info[] =
|
} pushm_info[] =
|
||||||
{
|
{
|
||||||
/* These are in push order. */
|
/* These are in reverse push (nearest-to-sp) order. */
|
||||||
{ FB_REGNO, 0x01, 2, 4 },
|
{ R0_REGNO, 0x80, 2, 2 },
|
||||||
{ SB_REGNO, 0x02, 2, 4 },
|
|
||||||
{ A1_REGNO, 0x04, 2, 4 },
|
|
||||||
{ A0_REGNO, 0x08, 2, 4 },
|
|
||||||
{ R3_REGNO, 0x10, 2, 2 },
|
|
||||||
{ R2_REGNO, 0x20, 2, 2 },
|
|
||||||
{ R1_REGNO, 0x40, 2, 2 },
|
{ R1_REGNO, 0x40, 2, 2 },
|
||||||
{ R0_REGNO, 0x80, 2, 2 }
|
{ R2_REGNO, 0x20, 2, 2 },
|
||||||
|
{ R3_REGNO, 0x10, 2, 2 },
|
||||||
|
{ A0_REGNO, 0x08, 2, 4 },
|
||||||
|
{ A1_REGNO, 0x04, 2, 4 },
|
||||||
|
{ SB_REGNO, 0x02, 2, 4 },
|
||||||
|
{ FB_REGNO, 0x01, 2, 4 }
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PUSHM_N (sizeof(pushm_info)/sizeof(pushm_info[0]))
|
#define PUSHM_N (sizeof(pushm_info)/sizeof(pushm_info[0]))
|
||||||
|
@ -1475,6 +1475,9 @@ m32c_function_arg (CUMULATIVE_ARGS * ca,
|
||||||
if (type && INTEGRAL_TYPE_P (type) && POINTER_TYPE_P (type))
|
if (type && INTEGRAL_TYPE_P (type) && POINTER_TYPE_P (type))
|
||||||
return NULL_RTX;
|
return NULL_RTX;
|
||||||
|
|
||||||
|
if (type && AGGREGATE_TYPE_P (type))
|
||||||
|
return NULL_RTX;
|
||||||
|
|
||||||
switch (ca->parm_num)
|
switch (ca->parm_num)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -1508,11 +1511,14 @@ m32c_pass_by_reference (CUMULATIVE_ARGS * ca ATTRIBUTE_UNUSED,
|
||||||
/* Implements INIT_CUMULATIVE_ARGS. */
|
/* Implements INIT_CUMULATIVE_ARGS. */
|
||||||
void
|
void
|
||||||
m32c_init_cumulative_args (CUMULATIVE_ARGS * ca,
|
m32c_init_cumulative_args (CUMULATIVE_ARGS * ca,
|
||||||
tree fntype ATTRIBUTE_UNUSED,
|
tree fntype,
|
||||||
rtx libname ATTRIBUTE_UNUSED,
|
rtx libname ATTRIBUTE_UNUSED,
|
||||||
tree fndecl ATTRIBUTE_UNUSED,
|
tree fndecl,
|
||||||
int n_named_args ATTRIBUTE_UNUSED)
|
int n_named_args ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
|
if (fntype && aggregate_value_p (TREE_TYPE (fntype), fndecl))
|
||||||
|
ca->force_mem = 1;
|
||||||
|
else
|
||||||
ca->force_mem = 0;
|
ca->force_mem = 0;
|
||||||
ca->parm_num = 1;
|
ca->parm_num = 1;
|
||||||
}
|
}
|
||||||
|
@ -1529,6 +1535,7 @@ m32c_function_arg_advance (CUMULATIVE_ARGS * ca,
|
||||||
{
|
{
|
||||||
if (ca->force_mem)
|
if (ca->force_mem)
|
||||||
ca->force_mem = 0;
|
ca->force_mem = 0;
|
||||||
|
else
|
||||||
ca->parm_num++;
|
ca->parm_num++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue