re PR debug/11473 (ICE with -gstabs when empty struct inheits from an empty struct)
[gcc.git] / gcc / dbxout.c
index 631e175dfb12525e5497f03b3f17bcbb2b8c2c85..770b0be14c112a5ece50ff172e943a89111ee710 100644 (file)
@@ -96,7 +96,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #undef DBXOUT_DECR_NESTING
 #define DBXOUT_DECR_NESTING \
   if (--debug_nesting == 0 && symbol_queue_index > 0) \
-    debug_flush_symbol_queue ()
+    { emit_pending_bincls_if_required (); debug_flush_symbol_queue (); }
 
 #undef DBXOUT_DECR_NESTING_AND_RETURN
 #define DBXOUT_DECR_NESTING_AND_RETURN(x) \
@@ -179,6 +179,8 @@ static GTY(()) int typevec_len;
 
 static GTY(()) int next_type_number;
 
+enum binclstatus {BINCL_NOT_REQUIRED, BINCL_PENDING, BINCL_PROCESSED};
+
 /* When using N_BINCL in dbx output, each type number is actually a
    pair of the file number and the type number within the file.
    This is a stack of input files.  */
@@ -188,6 +190,9 @@ struct dbx_file GTY(())
   struct dbx_file *next;
   int file_number;
   int next_type_number;
+  enum binclstatus bincl_status;      /* Keep track of lazy bincl.  */
+  const char *pending_bincl_name;     /* Name of bincl.  */
+  struct dbx_file *prev;              /* Chain to traverse all pending bincls.  */
 };
 
 /* This is the top of the stack.  */
@@ -231,6 +236,11 @@ static GTY(()) int lastfile_is_base;
 
 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
 
+#ifdef DBX_USE_BINCL
+/* If zero then there is no pending BINCL.  */
+static int pending_bincls = 0;
+#endif
+
 /* The original input file name.  */
 static const char *base_input_file;
 
@@ -307,46 +317,52 @@ static int current_sym_nchars;
 #define CONTIN do { } while (0)
 #endif
 
-static void dbxout_init                        PARAMS ((const char *));
-static void dbxout_finish              PARAMS ((const char *));
-static void dbxout_start_source_file   PARAMS ((unsigned, const char *));
-static void dbxout_end_source_file     PARAMS ((unsigned));
-static void dbxout_typedefs            PARAMS ((tree));
-static void dbxout_fptype_value                PARAMS ((tree));
-static void dbxout_type_index          PARAMS ((tree));
+#ifdef DBX_USE_BINCL
+static void emit_bincl_stab             (const char *c);
+static void emit_pending_bincls         (void);
+#endif
+static inline void emit_pending_bincls_if_required (void);
+
+static void dbxout_init (const char *);
+static void dbxout_finish (const char *);
+static void dbxout_start_source_file (unsigned, const char *);
+static void dbxout_end_source_file (unsigned);
+static void dbxout_typedefs (tree);
+static void dbxout_fptype_value (tree);
+static void dbxout_type_index (tree);
 #if DBX_CONTIN_LENGTH > 0
-static void dbxout_continue            PARAMS ((void));
+static void dbxout_continue (void);
 #endif
-static void dbxout_args                        PARAMS ((tree));
-static void dbxout_type_fields         PARAMS ((tree));
-static void dbxout_type_method_1       PARAMS ((tree, const char *));
-static void dbxout_type_methods                PARAMS ((tree));
-static void dbxout_range_type          PARAMS ((tree));
-static void dbxout_type                        PARAMS ((tree, int));
-static bool print_int_cst_bounds_in_octal_p    PARAMS ((tree));
-static void print_int_cst_octal                PARAMS ((tree));
-static void print_octal                        PARAMS ((unsigned HOST_WIDE_INT, int));
-static void print_wide_int             PARAMS ((HOST_WIDE_INT));
-static void dbxout_type_name           PARAMS ((tree));
-static void dbxout_class_name_qualifiers PARAMS ((tree));
-static int dbxout_symbol_location      PARAMS ((tree, tree, const char *, rtx));
-static void dbxout_symbol_name         PARAMS ((tree, const char *, int));
-static void dbxout_prepare_symbol      PARAMS ((tree));
-static void dbxout_finish_symbol       PARAMS ((tree));
-static void dbxout_block               PARAMS ((tree, int, tree));
-static void dbxout_global_decl         PARAMS ((tree));
-static void dbxout_handle_pch          PARAMS ((unsigned));
+static void dbxout_args (tree);
+static void dbxout_type_fields (tree);
+static void dbxout_type_method_1 (tree, const char *);
+static void dbxout_type_methods (tree);
+static void dbxout_range_type (tree);
+static void dbxout_type (tree, int);
+static bool print_int_cst_bounds_in_octal_p (tree);
+static void print_int_cst_octal (tree);
+static void print_octal (unsigned HOST_WIDE_INT, int);
+static void print_wide_int (HOST_WIDE_INT);
+static void dbxout_type_name (tree);
+static void dbxout_class_name_qualifiers (tree);
+static int dbxout_symbol_location (tree, tree, const char *, rtx);
+static void dbxout_symbol_name (tree, const char *, int);
+static void dbxout_prepare_symbol (tree);
+static void dbxout_finish_symbol (tree);
+static void dbxout_block (tree, int, tree);
+static void dbxout_global_decl (tree);
+static void dbxout_handle_pch (unsigned);
 \f
 /* The debug hooks structure.  */
 #if defined (DBX_DEBUGGING_INFO)
 
-static void dbxout_source_line         PARAMS ((unsigned int, const char *));
-static void dbxout_source_file         PARAMS ((FILE *, const char *));
-static void dbxout_function_end                PARAMS ((void));
-static void dbxout_begin_function      PARAMS ((tree));
-static void dbxout_begin_block         PARAMS ((unsigned, unsigned));
-static void dbxout_end_block           PARAMS ((unsigned, unsigned));
-static void dbxout_function_decl       PARAMS ((tree));
+static void dbxout_source_line (unsigned int, const char *);
+static void dbxout_source_file (FILE *, const char *);
+static void dbxout_function_end (void);
+static void dbxout_begin_function (tree);
+static void dbxout_begin_block (unsigned, unsigned);
+static void dbxout_end_block (unsigned, unsigned);
+static void dbxout_function_decl (tree);
 
 const struct gcc_debug_hooks dbx_debug_hooks =
 {
@@ -407,7 +423,7 @@ const struct gcc_debug_hooks xcoff_debug_hooks =
 \f
 #if defined (DBX_DEBUGGING_INFO)
 static void
-dbxout_function_end ()
+dbxout_function_end (void)
 {
   char lscope_label_name[100];
   /* Convert Ltext into the appropriate format for local labels in case
@@ -435,8 +451,7 @@ dbxout_function_end ()
    Initialize `typevec' and output the standard data types of C.  */
 
 static void
-dbxout_init (input_file_name)
-     const char *input_file_name;
+dbxout_init (const char *input_file_name)
 {
   char ltext_label_name[100];
   tree syms = (*lang_hooks.decls.getdecls) ();
@@ -503,6 +518,9 @@ dbxout_init (input_file_name)
   current_file->file_number = 0;
   current_file->next_type_number = 1;
   next_file_number = 1;
+  current_file->prev = NULL;
+  current_file->bincl_status = BINCL_NOT_REQUIRED;
+  current_file->pending_bincl_name = NULL;
 #endif
 
   /* Make sure that types `int' and `char' have numbers 1 and 2.
@@ -526,8 +544,7 @@ dbxout_init (input_file_name)
    in the reverse order from that which is found in SYMS.  */
 
 static void
-dbxout_typedefs (syms)
-     tree syms;
+dbxout_typedefs (tree syms)
 {
   if (syms)
     {
@@ -544,34 +561,97 @@ dbxout_typedefs (syms)
     }
 }
 
+#ifdef DBX_USE_BINCL
+/* Emit BINCL stab using given name.  */
+static void
+emit_bincl_stab (const char *name)
+{
+  fprintf (asmfile, "%s", ASM_STABS_OP);
+  output_quoted_string (asmfile, name);
+  fprintf (asmfile, ",%d,0,0,0\n", N_BINCL);
+}
+
+/* If there are pending bincls then it is time to emit all of them.  */
+
+static inline void
+emit_pending_bincls_if_required (void)
+{
+  if (pending_bincls)
+    emit_pending_bincls ();
+}
+
+/* Emit all pending bincls.  */
+
+static void
+emit_pending_bincls (void)
+{
+  struct dbx_file *f = current_file;
+
+  /* Find first pending bincl.  */
+  while (f->bincl_status == BINCL_PENDING)
+    f = f->next;
+
+  /* Now emit all bincls.  */
+  f = f->prev;
+
+  while (f)
+    {
+      if (f->bincl_status == BINCL_PENDING)
+        {
+          emit_bincl_stab (f->pending_bincl_name);
+
+         /* Update file number and status.  */
+          f->file_number = next_file_number++;
+          f->bincl_status = BINCL_PROCESSED;
+        }
+      if (f == current_file)
+        break;
+      f = f->prev;
+    }
+
+  /* All pending bincls have been emitted.  */
+  pending_bincls = 0;
+}
+
+#else
+
+static inline void
+emit_pending_bincls_if_required (void) {}
+#endif
+
 /* Change to reading from a new source file.  Generate a N_BINCL stab.  */
 
 static void
-dbxout_start_source_file (line, filename)
-     unsigned int line ATTRIBUTE_UNUSED;
-     const char *filename ATTRIBUTE_UNUSED;
+dbxout_start_source_file (unsigned int line ATTRIBUTE_UNUSED,
+                         const char *filename ATTRIBUTE_UNUSED)
 {
 #ifdef DBX_USE_BINCL
   struct dbx_file *n = (struct dbx_file *) ggc_alloc (sizeof *n);
 
   n->next = current_file;
-  n->file_number = next_file_number++;
   n->next_type_number = 1;
+  /* Do not assign file number now. 
+     Delay it until we actually emit BINCL.  */
+  n->file_number = 0;
+  n->prev = NULL;
+  current_file->prev = n;
+  n->bincl_status = BINCL_PENDING;
+  n->pending_bincl_name = filename;
+  pending_bincls = 1;
   current_file = n;
-  fprintf (asmfile, "%s", ASM_STABS_OP);
-  output_quoted_string (asmfile, filename);
-  fprintf (asmfile, ",%d,0,0,0\n", N_BINCL);
 #endif
 }
 
 /* Revert to reading a previous source file.  Generate a N_EINCL stab.  */
 
 static void
-dbxout_end_source_file (line)
-     unsigned int line ATTRIBUTE_UNUSED;
+dbxout_end_source_file (unsigned int line ATTRIBUTE_UNUSED)
 {
 #ifdef DBX_USE_BINCL
-  fprintf (asmfile, "%s%d,0,0,0\n", ASM_STABN_OP, N_EINCL);
+  /* Emit EINCL stab only if BINCL is not pending.  */
+  if (current_file->bincl_status == BINCL_PROCESSED)
+    fprintf (asmfile, "%s%d,0,0,0\n", ASM_STABN_OP, N_EINCL);
+  current_file->bincl_status = BINCL_NOT_REQUIRED;
   current_file = current_file->next;
 #endif
 }
@@ -605,9 +685,7 @@ dbxout_handle_pch (unsigned at_end)
 /* Output debugging info to FILE to switch to sourcefile FILENAME.  */
 
 static void
-dbxout_source_file (file, filename)
-     FILE *file;
-     const char *filename;
+dbxout_source_file (FILE *file, const char *filename)
 {
   if (lastfile == 0 && lastfile_is_base)
     {
@@ -641,9 +719,7 @@ dbxout_source_file (file, filename)
    number LINENO.  */
 
 static void
-dbxout_source_line (lineno, filename)
-     unsigned int lineno;
-     const char *filename;
+dbxout_source_line (unsigned int lineno, const char *filename)
 {
   dbxout_source_file (asmfile, filename);
 
@@ -658,20 +734,18 @@ dbxout_source_line (lineno, filename)
 /* Describe the beginning of an internal block within a function.  */
 
 static void
-dbxout_begin_block (line, n)
-     unsigned int line ATTRIBUTE_UNUSED;
-     unsigned int n;
+dbxout_begin_block (unsigned int line ATTRIBUTE_UNUSED, unsigned int n)
 {
+  emit_pending_bincls_if_required ();
   (*targetm.asm_out.internal_label) (asmfile, "LBB", n);
 }
 
 /* Describe the end line-number of an internal block within a function.  */
 
 static void
-dbxout_end_block (line, n)
-     unsigned int line ATTRIBUTE_UNUSED;
-     unsigned int n;
+dbxout_end_block (unsigned int line ATTRIBUTE_UNUSED, unsigned int n)
 {
+  emit_pending_bincls_if_required ();
   (*targetm.asm_out.internal_label) (asmfile, "LBE", n);
 }
 
@@ -682,9 +756,9 @@ dbxout_end_block (line, n)
    (including all the auto variables of the function).  */
 
 static void
-dbxout_function_decl (decl)
-     tree decl;
+dbxout_function_decl (tree decl)
 {
+  emit_pending_bincls_if_required ();
 #ifndef DBX_FUNCTION_FIRST
   dbxout_begin_function (decl);
 #endif
@@ -705,8 +779,7 @@ dbxout_function_decl (decl)
 /* Debug information for a global DECL.  Called from toplev.c after
    compilation proper has finished.  */
 static void
-dbxout_global_decl (decl)
-     tree decl;
+dbxout_global_decl (tree decl)
 {
   if (TREE_CODE (decl) == VAR_DECL
       && ! DECL_EXTERNAL (decl)
@@ -724,8 +797,7 @@ dbxout_global_decl (decl)
    to do nothing.  */
 
 static void
-dbxout_finish (filename)
-     const char *filename ATTRIBUTE_UNUSED;
+dbxout_finish (const char *filename ATTRIBUTE_UNUSED)
 {
 #ifdef DBX_OUTPUT_MAIN_SOURCE_FILE_END
   DBX_OUTPUT_MAIN_SOURCE_FILE_END (asmfile, filename);
@@ -752,8 +824,7 @@ dbxout_finish (filename)
    them.  */
 
 static void
-dbxout_fptype_value (type)
-     tree type;
+dbxout_fptype_value (tree type)
 {
   char value = '0';
   enum machine_mode mode = TYPE_MODE (type);
@@ -792,8 +863,7 @@ dbxout_fptype_value (type)
 /* Output the index of a type.  */
 
 static void
-dbxout_type_index (type)
-     tree type;
+dbxout_type_index (tree type)
 {
 #ifndef DBX_USE_BINCL
   fprintf (asmfile, "%d", TYPE_SYMTAB_ADDRESS (type));
@@ -813,8 +883,9 @@ dbxout_type_index (type)
    .stabs "...rest",code,0,value   */
 
 static void
-dbxout_continue ()
+dbxout_continue (void)
 {
+  emit_pending_bincls_if_required ();
 #ifdef DBX_CONTIN_CHAR
   fprintf (asmfile, "%c", DBX_CONTIN_CHAR);
 #else
@@ -831,8 +902,7 @@ dbxout_continue ()
    recursive calls.  */
 
 static void
-dbxout_type_fields (type)
-     tree type;
+dbxout_type_fields (tree type)
 {
   tree tem;
 
@@ -922,9 +992,7 @@ dbxout_type_fields (type)
    now.  */
 
 static void
-dbxout_type_method_1 (decl, debug_name)
-     tree decl;
-     const char *debug_name;
+dbxout_type_method_1 (tree decl, const char *debug_name)
 {
   char c1 = 'A', c2;
 
@@ -969,8 +1037,7 @@ dbxout_type_method_1 (decl, debug_name)
    in TYPE.  */
 
 static void
-dbxout_type_methods (type)
-     tree type;
+dbxout_type_methods (tree type)
 {
   /* C++: put out the method names and their parameter lists */
   tree methods = TYPE_METHODS (type);
@@ -1075,8 +1142,7 @@ dbxout_type_methods (type)
    TYPE is an INTEGER_TYPE.  */
 
 static void
-dbxout_range_type (type)
-     tree type;
+dbxout_range_type (tree type)
 {
   fprintf (asmfile, "r");
   if (TREE_TYPE (type))
@@ -1150,9 +1216,7 @@ dbxout_range_type (type)
    using the number previously allocated.  */
 
 static void
-dbxout_type (type, full)
-     tree type;
-     int full;
+dbxout_type (tree type, int full)
 {
   tree tem;
   tree main_variant;
@@ -1199,7 +1263,7 @@ dbxout_type (type, full)
        {
          typevec
            = (struct typeinfo *) ggc_realloc (typevec,
-                                              (typevec_len * 2 
+                                              (typevec_len * 2
                                                * sizeof typevec[0]));
          memset ((char *) (typevec + typevec_len), 0,
                 typevec_len * sizeof typevec[0]);
@@ -1207,6 +1271,7 @@ dbxout_type (type, full)
        }
 
 #ifdef DBX_USE_BINCL
+      emit_pending_bincls_if_required ();
       typevec[TYPE_SYMTAB_ADDRESS (type)].file_number
        = current_file->file_number;
       typevec[TYPE_SYMTAB_ADDRESS (type)].type_number
@@ -1228,7 +1293,7 @@ dbxout_type (type, full)
               && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
        debug_queue_symbol (TYPE_NAME (type));
     }
-  
+
   /* Output the number of this type, to refer to it.  */
   dbxout_type_index (type);
 
@@ -1316,7 +1381,7 @@ dbxout_type (type, full)
         {
           tree orig_type = DECL_ORIGINAL_TYPE (TYPE_NAME (type));
 
-          if ((TREE_CODE (orig_type) == RECORD_TYPE  
+          if ((TREE_CODE (orig_type) == RECORD_TYPE
                || TREE_CODE (orig_type) == UNION_TYPE
                || TREE_CODE (orig_type) == QUAL_UNION_TYPE
                || TREE_CODE (orig_type) == ENUMERAL_TYPE)
@@ -1389,7 +1454,7 @@ dbxout_type (type, full)
              CHARS (5);
            }
 
-         if (print_int_cst_bounds_in_octal_p (type))
+         if (print_int_cst_bounds_in_octal_p (type))
            {
              fprintf (asmfile, "r");
              CHARS (1);
@@ -1654,7 +1719,7 @@ dbxout_type (type, full)
            tree child = BINFO_BASETYPE (binfo, i);
            tree access = (BINFO_BASEACCESSES (binfo)
                           ? BINFO_BASEACCESS (binfo, i) : access_public_node);
-           
+
            if (use_gnu_debug_info_extensions)
              {
                have_used_extensions = 1;
@@ -1691,9 +1756,7 @@ dbxout_type (type, full)
                                * BITS_PER_UNIT);
                putc (',', asmfile);
                CHARS (1);
-               print_wide_int (tree_low_cst (DECL_SIZE
-                                             (TYPE_NAME
-                                              (BINFO_TYPE (child))),
+               print_wide_int (tree_low_cst (TYPE_SIZE (BINFO_TYPE (child)),
                                              0)
                                * BITS_PER_UNIT);
                putc (';', asmfile);
@@ -1854,8 +1917,7 @@ dbxout_type (type, full)
    should be printed in octal format.  */
 
 static bool
-print_int_cst_bounds_in_octal_p (type)
-     tree type;
+print_int_cst_bounds_in_octal_p (tree type)
 {
   /* If we can use GDB extensions and the size is wider than a long
      (the size used by GDB to read them) or we may have trouble writing
@@ -1863,7 +1925,7 @@ print_int_cst_bounds_in_octal_p (type)
      the *target's* size of "long", not that of the host.  The host test
      is just to make sure we can write it out in case the host wide int
      is narrower than the target "long".
-  
+
      For unsigned types, we use octal if they are the same size or larger.
      This is because we print the bounds as signed decimal, and hence they
      can't span same size unsigned types.  */
@@ -1888,8 +1950,7 @@ print_int_cst_bounds_in_octal_p (type)
    handling double precision.  */
 
 static void
-print_int_cst_octal (c)
-     tree c;
+print_int_cst_octal (tree c)
 {
   unsigned HOST_WIDE_INT high = TREE_INT_CST_HIGH (c);
   unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (c);
@@ -1934,9 +1995,7 @@ print_int_cst_octal (c)
 }
 
 static void
-print_octal (value, digits)
-     unsigned HOST_WIDE_INT value;
-     int digits;
+print_octal (unsigned HOST_WIDE_INT value, int digits)
 {
   int i;
 
@@ -1949,8 +2008,7 @@ print_octal (value, digits)
 /* Output C in decimal while adjusting the number of digits written.  */
 
 static void
-print_wide_int (c)
-     HOST_WIDE_INT c;
+print_wide_int (HOST_WIDE_INT c)
 {
   int digs = 0;
 
@@ -1970,8 +2028,7 @@ print_wide_int (c)
    or by struct, enum and union tags.  */
 
 static void
-dbxout_type_name (type)
-     tree type;
+dbxout_type_name (tree type)
 {
   tree t;
   if (TYPE_NAME (type) == 0)
@@ -1995,19 +2052,20 @@ dbxout_type_name (type)
    type whose scope is limited to a struct or class.  */
 
 static void
-dbxout_class_name_qualifiers (decl)
-     tree decl;
+dbxout_class_name_qualifiers (tree decl)
 {
   tree context = decl_type_context (decl);
 
-  if (context != NULL_TREE 
+  if (context != NULL_TREE
       && TREE_CODE(context) == RECORD_TYPE
-      && TYPE_NAME (context) != 0 
+      && TYPE_NAME (context) != 0
       && (TREE_CODE (TYPE_NAME (context)) == IDENTIFIER_NODE
           || (DECL_NAME (TYPE_NAME (context)) != 0)))
     {
       tree name = TYPE_NAME (context);
 
+      emit_pending_bincls_if_required ();
+
       if (TREE_CODE (name) == TYPE_DECL)
        {
          dbxout_class_name_qualifiers (name);
@@ -2025,9 +2083,7 @@ dbxout_class_name_qualifiers (decl)
    Return 1 if a stabs might have been emitted.  */
 
 int
-dbxout_symbol (decl, local)
-     tree decl;
-     int local ATTRIBUTE_UNUSED;
+dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
 {
   tree type = TREE_TYPE (decl);
   tree context = NULL_TREE;
@@ -2047,10 +2103,10 @@ dbxout_symbol (decl, local)
       || DECL_IGNORED_P (decl))
     DBXOUT_DECR_NESTING_AND_RETURN (0);
 
-  /* If we are to generate only the symbols actualy used then such
+  /* If we are to generate only the symbols actually used then such
      symbol nodees are flagged with TREE_USED.  Ignore any that
      aren't flaged as TREE_USED.  */
-    
+
   if (flag_debug_only_used_symbols)
     {
       tree t;
@@ -2069,7 +2125,7 @@ dbxout_symbol (decl, local)
          pointer to a named type we need to look for the first name
          we see following the TREE_TYPE chain.  */
 
-      t = type;    
+      t = type;
       while (POINTER_TYPE_P (t))
         t = TREE_TYPE (t);
 
@@ -2102,6 +2158,8 @@ dbxout_symbol (decl, local)
         debug_queue_symbol (TYPE_NAME (t));
     }
 
+  emit_pending_bincls_if_required ();
+
   dbxout_prepare_symbol (decl);
 
   /* The output will always start with the symbol name,
@@ -2369,14 +2427,13 @@ dbxout_symbol (decl, local)
    Returns 1 if the stab was really emitted.  */
 
 static int
-dbxout_symbol_location (decl, type, suffix, home)
-     tree decl, type;
-     const char *suffix;
-     rtx home;
+dbxout_symbol_location (tree decl, tree type, const char *suffix, rtx home)
 {
   int letter = 0;
   int regno = -1;
 
+  emit_pending_bincls_if_required ();
+
   /* Don't mention a variable at all
      if it was completely optimized into nothingness.
 
@@ -2605,10 +2662,7 @@ dbxout_symbol_location (decl, type, suffix, home)
    Then output LETTER to indicate the kind of location the symbol has.  */
 
 static void
-dbxout_symbol_name (decl, suffix, letter)
-     tree decl;
-     const char *suffix;
-     int letter;
+dbxout_symbol_name (tree decl, const char *suffix, int letter)
 {
   const char *name;
 
@@ -2633,8 +2687,7 @@ dbxout_symbol_name (decl, suffix, letter)
 }
 
 static void
-dbxout_prepare_symbol (decl)
-     tree decl ATTRIBUTE_UNUSED;
+dbxout_prepare_symbol (tree decl ATTRIBUTE_UNUSED)
 {
 #ifdef WINNING_GDB
   const char *filename = DECL_SOURCE_FILE (decl);
@@ -2644,8 +2697,7 @@ dbxout_prepare_symbol (decl)
 }
 
 static void
-dbxout_finish_symbol (sym)
-     tree sym;
+dbxout_finish_symbol (tree sym)
 {
 #ifdef DBX_FINISH_SYMBOL
   DBX_FINISH_SYMBOL (sym);
@@ -2667,8 +2719,7 @@ dbxout_finish_symbol (sym)
    anything was output */
 
 int
-dbxout_syms (syms)
-     tree syms;
+dbxout_syms (tree syms)
 {
   int result = 0;
   while (syms)
@@ -2692,11 +2743,12 @@ dbxout_syms (syms)
    of all the parms in PARMS, which is a chain of PARM_DECL nodes.  */
 
 void
-dbxout_parms (parms)
-     tree parms;
+dbxout_parms (tree parms)
 {
   ++debug_nesting;
 
+  emit_pending_bincls_if_required ();
+
   for (; parms; parms = TREE_CHAIN (parms))
     if (DECL_NAME (parms) && TREE_TYPE (parms) != error_mark_node)
       {
@@ -2969,8 +3021,7 @@ dbxout_parms (parms)
    PARMS is a chain of PARM_DECL nodes.  */
 
 void
-dbxout_reg_parms (parms)
-     tree parms;
+dbxout_reg_parms (tree parms)
 {
   ++debug_nesting;
 
@@ -3001,8 +3052,7 @@ dbxout_reg_parms (parms)
    output definitions of those names, in raw form */
 
 static void
-dbxout_args (args)
-     tree args;
+dbxout_args (tree args)
 {
   while (args)
     {
@@ -3031,10 +3081,7 @@ dbxout_args (args)
    We handle them all in sequence.  */
 
 static void
-dbxout_block (block, depth, args)
-     tree block;
-     int depth;
-     tree args;
+dbxout_block (tree block, int depth, tree args)
 {
   int blocknum = -1;
 
@@ -3129,14 +3176,13 @@ dbxout_block (block, depth, args)
 
 #if defined (DBX_DEBUGGING_INFO)
 static void
-dbxout_begin_function (decl)
-     tree decl;
+dbxout_begin_function (tree decl)
 {
   int saved_tree_used1 = TREE_USED (decl);
   TREE_USED (decl) = 1;
   if (DECL_NAME (DECL_RESULT (decl)) != 0)
     {
-      int saved_tree_used2 = TREE_USED (DECL_RESULT (decl));       
+      int saved_tree_used2 = TREE_USED (DECL_RESULT (decl));
       TREE_USED (DECL_RESULT (decl)) = 1;
       dbxout_symbol (decl, 0);
       TREE_USED (DECL_RESULT (decl)) = saved_tree_used2;