h8300.c (extra_pop): Remove unused variable.
authorJeff Law <law@gcc.gnu.org>
Tue, 2 Apr 1996 18:53:54 +0000 (11:53 -0700)
committerJeff Law <law@gcc.gnu.org>
Tue, 2 Apr 1996 18:53:54 +0000 (11:53 -0700)
        * 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

gcc/config/h8300/h8300.c
gcc/config/h8300/h8300.h

index 6a85ecb9ebcd0c18d2d072f1d2a32a1ca2a0c9c3..8abe7d7a4ba196a51f442a19640d758cc3a46db5 100644 (file)
@@ -180,11 +180,6 @@ static int pop_order[FIRST_PSEUDO_REGISTER] =
    <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
 function_prologue (file, size)
      FILE *file;
@@ -193,50 +188,12 @@ function_prologue (file, size)
   register int mask = 0;
   int fsize = (size + STACK_BOUNDARY / 8 - 1) & -STACK_BOUNDARY / 8;
   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))
     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)
     {
       /* Push fp */
@@ -321,28 +278,13 @@ function_epilogue (file, size)
       dosize (file, "add", fsize, 0);
     }
 
-  if (extra_pop)
-    {
-      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]);
-    }
+  if (interrupt_handler)
+    fprintf (file, "\trte\n");
   else
-    {
-      if (interrupt_handler)
-       fprintf (file, "\trte\n");
-      else
-       fprintf (file, "\trts\n");
-    }
+    fprintf (file, "\trts\n");
 
   interrupt_handler = 0;
   pragma_saveall = 0;
-
-  current_function_anonymous_args = 0;
 }
 
 /* Output assembly code for the start of the file.  */
@@ -652,6 +594,10 @@ function_arg (cum, mode, type, named)
   char *fname;
   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.  */
   if (TARGET_QUICKCALL)
     regpass = 3;
index 197d814933fefc29f515b3532eebb49a7f06c66a..2a0f451c73eacf4dc1a997bc8cdce708cc79ac87 100644 (file)
@@ -170,7 +170,7 @@ do {                                \
 #define SHORT_TYPE_SIZE        16
 #define INT_TYPE_SIZE          (TARGET_INT32 ? 32 : 16)
 #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 DOUBLE_TYPE_SIZE       32
 #define LONG_DOUBLE_TYPE_SIZE  DOUBLE_TYPE_SIZE
@@ -612,13 +612,6 @@ struct rtx_def *function_arg();
 #define 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.  */
 
 #define FUNCTION_PROLOGUE(FILE, SIZE) \