Commit dd07092e by Jeff Law

h8300.c (extra_pop): Remove unused variable.

        * h8300/h8300.c (extra_pop): Remove unused variable.
        (current_function_anonymous_args): Likewise.
        (function_prologue): Remove incorrect varargs/stdarg
        related code.
        (function_epilogue): Likewise.
        (function_arg): Never pass unnamed arguments in registers.
        * h8300.h (LONG_LONG_TYPE_SIZE): Use 64bits when ints are
        32bits.
        (SETUP_INCOMING_VARARGS): Remove definition.

From-SVN: r11653
parent cf0a001c
...@@ -180,11 +180,6 @@ static int pop_order[FIRST_PSEUDO_REGISTER] = ...@@ -180,11 +180,6 @@ static int pop_order[FIRST_PSEUDO_REGISTER] =
<saved registers> <- sp <saved registers> <- sp
*/ */
int current_function_anonymous_args;
/* Extra arguments to pop, in words (IE: 2 bytes for 300, 4 for 300h */
static int extra_pop;
void void
function_prologue (file, size) function_prologue (file, size)
FILE *file; FILE *file;
...@@ -193,50 +188,12 @@ function_prologue (file, size) ...@@ -193,50 +188,12 @@ function_prologue (file, size)
register int mask = 0; register int mask = 0;
int fsize = (size + STACK_BOUNDARY / 8 - 1) & -STACK_BOUNDARY / 8; int fsize = (size + STACK_BOUNDARY / 8 - 1) & -STACK_BOUNDARY / 8;
int idx; int idx;
extra_pop = 0;
/* Note a function with the interrupt attribute and set interrupt_handler
accordingly. */
if (h8300_interrupt_function_p (current_function_decl)) if (h8300_interrupt_function_p (current_function_decl))
interrupt_handler = 1; interrupt_handler = 1;
if (current_function_anonymous_args && TARGET_QUICKCALL)
{
/* Push regs as if done by caller, and move around return address. */
switch (current_function_args_info.nbytes / UNITS_PER_WORD)
{
case 0:
/* get ret addr */
fprintf (file, "\t%s\t%s\n", h8_pop_op, h8_reg_names[3]);
fprintf (file, "\t%s\t%s\n", h8_push_op, h8_reg_names[2]);
fprintf (file, "\t%s\t%s\n", h8_push_op, h8_reg_names[1]);
fprintf (file, "\t%s\t%s\n", h8_push_op, h8_reg_names[0]);
/* push it again */
fprintf (file, "\t%s\t%s\n", h8_push_op, h8_reg_names[3]);
extra_pop = 3;
break;
case 1:
/* get ret addr */
fprintf (file, "\t%s\t%s\n", h8_pop_op, h8_reg_names[3]);
fprintf (file, "\t%s\t%s\n", h8_push_op, h8_reg_names[2]);
fprintf (file, "\t%s\t%s\n", h8_push_op, h8_reg_names[1]);
/* push it again */
fprintf (file, "\t%s\t%s\n", h8_push_op, h8_reg_names[3]);
extra_pop = 2;
break;
case 2:
/* get ret addr */
fprintf (file, "\t%s\t%s\n", h8_pop_op, h8_reg_names[3]);
fprintf (file, "\t%s\t%s\n", h8_push_op, h8_reg_names[2]);
/* push it again */
fprintf (file, "\t%s\t%s\n", h8_push_op, h8_reg_names[3]);
extra_pop = 1;
break;
default:
fprintf (file, "; varargs\n");
break;
}
}
if (frame_pointer_needed) if (frame_pointer_needed)
{ {
/* Push fp */ /* Push fp */
...@@ -321,28 +278,13 @@ function_epilogue (file, size) ...@@ -321,28 +278,13 @@ function_epilogue (file, size)
dosize (file, "add", fsize, 0); dosize (file, "add", fsize, 0);
} }
if (extra_pop) if (interrupt_handler)
{ fprintf (file, "\trte\n");
fprintf (file, "\t%s\t%s\n", h8_pop_op, h8_reg_names[3]);
while (extra_pop)
{
fprintf (file, "\t%s\t%s\n", h8_pop_op, h8_reg_names[2]);
extra_pop--;
}
fprintf (file, "\tjmp @%s\n", h8_reg_names[3]);
}
else else
{ fprintf (file, "\trts\n");
if (interrupt_handler)
fprintf (file, "\trte\n");
else
fprintf (file, "\trts\n");
}
interrupt_handler = 0; interrupt_handler = 0;
pragma_saveall = 0; pragma_saveall = 0;
current_function_anonymous_args = 0;
} }
/* Output assembly code for the start of the file. */ /* Output assembly code for the start of the file. */
...@@ -652,6 +594,10 @@ function_arg (cum, mode, type, named) ...@@ -652,6 +594,10 @@ function_arg (cum, mode, type, named)
char *fname; char *fname;
int regpass = 0; int regpass = 0;
/* Never pass unnamed arguments in registers. */
if (!named)
return 0;
/* Pass 3 regs worth of data in regs when user asked on the command line. */ /* Pass 3 regs worth of data in regs when user asked on the command line. */
if (TARGET_QUICKCALL) if (TARGET_QUICKCALL)
regpass = 3; regpass = 3;
......
...@@ -170,7 +170,7 @@ do { \ ...@@ -170,7 +170,7 @@ do { \
#define SHORT_TYPE_SIZE 16 #define SHORT_TYPE_SIZE 16
#define INT_TYPE_SIZE (TARGET_INT32 ? 32 : 16) #define INT_TYPE_SIZE (TARGET_INT32 ? 32 : 16)
#define LONG_TYPE_SIZE 32 #define LONG_TYPE_SIZE 32
#define LONG_LONG_TYPE_SIZE 32 #define LONG_LONG_TYPE_SIZE (TARGET_INT32 ? 64 : 32)
#define FLOAT_TYPE_SIZE 32 #define FLOAT_TYPE_SIZE 32
#define DOUBLE_TYPE_SIZE 32 #define DOUBLE_TYPE_SIZE 32
#define LONG_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE #define LONG_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE
...@@ -612,13 +612,6 @@ struct rtx_def *function_arg(); ...@@ -612,13 +612,6 @@ struct rtx_def *function_arg();
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&CUM, MODE, TYPE, NAMED) function_arg (&CUM, MODE, TYPE, NAMED)
/* Perform any needed actions needed for a function that is receiving a
variable number of arguments. */
extern int current_function_anonymous_args;
#define SETUP_INCOMING_VARARGS(ASF, MODE, TYPE, PAS, ST) \
current_function_anonymous_args = 1;
/* Generate assembly output for the start of a function. */ /* Generate assembly output for the start of a function. */
#define FUNCTION_PROLOGUE(FILE, SIZE) \ #define FUNCTION_PROLOGUE(FILE, SIZE) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment