OSDN Git Service

(tablejump_internal4+1): Fix typo in condition.
[pf3gnuchains/gcc-fork.git] / gcc / dwarfout.c
index ccf436b..4193604 100644 (file)
@@ -1,9 +1,6 @@
 /* Output Dwarf format symbol table information from the GNU C compiler.
-   Copyright (C) 1992, 1993 Free Software Foundation, Inc.
-
-   Written by Ron Guilmette (rfg@netcom.com) for
-   Network Computing Devices, August, September, October, November 1990.
-   Generously contributed by NCD to the Free Software Foundation.
+   Copyright (C) 1992, 1993, 1995, 1996 Free Software Foundation, Inc.
+   Contributed by Ron Guilmette (rfg@monkeys.com) of Network Computing Devices.
 
 This file is part of GNU CC.
 
@@ -19,7 +16,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 #include "config.h"
 
@@ -71,10 +69,8 @@ extern char *rindex ();
 /* Note that the implementation of C++ support herein is (as yet) unfinished.
    If you want to try to complete it, more power to you.  */
 
-#if defined(__GNUC__) && (NDEBUG == 1)
-#define inline static inline
-#else
-#define inline static
+#if !defined(__GNUC__) || (NDEBUG != 1)
+#define inline
 #endif
 
 /* How to start an assembler comment.  */
@@ -294,11 +290,118 @@ static tree dwarf_last_decl;
 
 /* Forward declarations for functions defined in this file.  */
 
-static void output_type ();
-static void type_attribute ();
-static void output_decls_for_scope ();
-static void output_decl ();
-static unsigned lookup_filename ();
+static char *dwarf_tag_name            PROTO((unsigned));
+static char *dwarf_attr_name           PROTO((unsigned));
+static char *dwarf_stack_op_name       PROTO((unsigned));
+static char *dwarf_typemod_name                PROTO((unsigned));
+static char *dwarf_fmt_byte_name       PROTO((unsigned));
+static char *dwarf_fund_type_name      PROTO((unsigned));
+static tree decl_ultimate_origin       PROTO((tree));
+static tree block_ultimate_origin      PROTO((tree));
+static void output_unsigned_leb128     PROTO((unsigned long));
+static void output_signed_leb128       PROTO((long));
+static inline int is_body_block                PROTO((tree));
+static int fundamental_type_code       PROTO((tree));
+static tree root_type                  PROTO((tree));
+static void write_modifier_bytes       PROTO((tree, int, int));
+static inline int type_is_fundamental  PROTO((tree));
+static void equate_decl_number_to_die_number PROTO((tree));
+static inline void equate_type_number_to_die_number PROTO((tree));
+static void output_reg_number          PROTO((rtx));
+static void output_mem_loc_descriptor  PROTO((rtx));
+static void output_loc_descriptor      PROTO((rtx));
+static void output_bound_representation        PROTO((tree, unsigned, char));
+static void output_enumeral_list       PROTO((tree));
+static inline unsigned ceiling         PROTO((unsigned, unsigned));
+static inline tree field_type          PROTO((tree));
+static inline unsigned simple_type_align_in_bits PROTO((tree));
+static inline unsigned simple_type_size_in_bits  PROTO((tree));
+static unsigned field_byte_offset      PROTO((tree));
+static inline void sibling_attribute   PROTO((void));
+static void location_attribute         PROTO((rtx));
+static void data_member_location_attribute PROTO((tree));
+static void const_value_attribute      PROTO((rtx));
+static void location_or_const_value_attribute PROTO((tree));
+static inline void name_attribute      PROTO((char *));
+static inline void fund_type_attribute PROTO((unsigned));
+static void mod_fund_type_attribute    PROTO((tree, int, int));
+static inline void user_def_type_attribute PROTO((tree));
+static void mod_u_d_type_attribute     PROTO((tree, int, int));
+static inline void ordering_attribute  PROTO((unsigned));
+static void subscript_data_attribute   PROTO((tree));
+static void byte_size_attribute                PROTO((tree));
+static inline void bit_offset_attribute        PROTO((tree));
+static inline void bit_size_attribute  PROTO((tree));
+static inline void element_list_attribute PROTO((tree));
+static inline void stmt_list_attribute PROTO((char *));
+static inline void low_pc_attribute    PROTO((char *));
+static inline void high_pc_attribute   PROTO((char *));
+static inline void body_begin_attribute        PROTO((char *));
+static inline void body_end_attribute  PROTO((char *));
+static inline void langauge_attribute  PROTO((unsigned));
+static inline void member_attribute    PROTO((tree));
+static inline void string_length_attribute PROTO((tree));
+static inline void comp_dir_attribute  PROTO((char *));
+static inline void sf_names_attribute  PROTO((char *));
+static inline void src_info_attribute  PROTO((char *));
+static inline void mac_info_attribute  PROTO((char *));
+static inline void prototyped_attribute        PROTO((tree));
+static inline void producer_attribute  PROTO((char *));
+static inline void inline_attribute    PROTO((tree));
+static inline void containing_type_attribute PROTO((tree));
+static inline void abstract_origin_attribute PROTO((tree));
+static inline void src_coords_attribute PROTO((unsigned, unsigned));
+static inline void pure_or_virtual_attribute PROTO((tree));
+static void name_and_src_coords_attributes PROTO((tree));
+static void type_attribute             PROTO((tree, int, int));
+static char *type_tag                  PROTO((tree));
+static inline void dienum_push         PROTO((void));
+static inline void dienum_pop          PROTO((void));
+static inline tree member_declared_type PROTO((tree));
+static char *function_start_label      PROTO((tree));
+static void output_array_type_die      PROTO((void *));
+static void output_set_type_die                PROTO((void *));
+static void output_entry_point_die     PROTO((void *));
+static void output_inlined_enumeration_type_die PROTO((void *));
+static void output_inlined_structure_type_die PROTO((void *));
+static void output_inlined_union_type_die PROTO((void *));
+static void output_enumeration_type_die        PROTO((void *));
+static void output_formal_parameter_die        PROTO((void *));
+static void output_global_subroutine_die PROTO((void *));
+static void output_global_variable_die PROTO((void *));
+static void output_label_die           PROTO((void *));
+static void output_lexical_block_die   PROTO((void *));
+static void output_inlined_subroutine_die PROTO((void *));
+static void output_local_variable_die  PROTO((void *));
+static void output_member_die          PROTO((void *));
+static void output_pointer_type_die    PROTO((void *));
+static void output_reference_type_die  PROTO((void *));
+static void output_ptr_to_mbr_type_die PROTO((void *));
+static void output_compile_unit_die    PROTO((void *));
+static void output_string_type_die     PROTO((void *));
+static void output_structure_type_die  PROTO((void *));
+static void output_local_subroutine_die PROTO((void *));
+static void output_subroutine_type_die PROTO((void *));
+static void output_typedef_die         PROTO((void *));
+static void output_union_type_die      PROTO((void *));
+static void output_unspecified_parameters_die PROTO((void *));
+static void output_padded_null_die     PROTO((void *));
+static void output_die                 PROTO((void (*) (), void *));
+static void end_sibling_chain          PROTO((void));
+static void output_formal_types                PROTO((tree));
+static void pend_type                  PROTO((tree));
+static inline int type_of_for_scope    PROTO((tree, tree));
+static void output_pending_types_for_scope PROTO((tree));
+static void output_type                        PROTO((tree, tree));
+static void output_tagged_type_instantiation PROTO((tree));
+static void output_block               PROTO((tree));
+static void output_decls_for_scope     PROTO((tree));
+static void output_decl                        PROTO((tree, tree));
+static void shuffle_filename_entry     PROTO((filename_entry *));
+static void geneate_new_sfname_entry   PROTO((void));
+static unsigned lookup_filename                PROTO((char *));
+static void generate_srcinfo_entry     PROTO((unsigned, unsigned));
+static void generate_macinfo_entry     PROTO((char *, char *));
 \f
 /* Definitions of defaults for assembler-dependent names of various
    pseudo-ops and section names.
@@ -347,7 +450,7 @@ static unsigned lookup_filename ();
    section name must be enclosed in double quotes.  (See sparcv4.h.)  */
 
 #ifndef PUSHSECTION_FORMAT
-#define PUSHSECTION_FORMAT     "%s\t%s\n"
+#define PUSHSECTION_FORMAT     "\t%s\t%s\n"
 #endif
 
 #ifndef DEBUG_SECTION
@@ -607,7 +710,7 @@ static unsigned lookup_filename ();
   do {                                                                 \
     fprintf ((FILE), "\t%s\t0x%x",                                     \
                     UNALIGNED_SHORT_ASM_OP, (unsigned) TAG);           \
-    if (flag_verbose_asm)                                              \
+    if (flag_debug_asm)                                                        \
       fprintf ((FILE), "\t%s %s",                                      \
                       ASM_COMMENT_START, dwarf_tag_name (TAG));        \
     fputc ('\n', (FILE));                                              \
@@ -619,7 +722,7 @@ static unsigned lookup_filename ();
   do {                                                                 \
     fprintf ((FILE), "\t%s\t0x%x",                                     \
                     UNALIGNED_SHORT_ASM_OP, (unsigned) ATTR);          \
-    if (flag_verbose_asm)                                              \
+    if (flag_debug_asm)                                                        \
       fprintf ((FILE), "\t%s %s",                                      \
                       ASM_COMMENT_START, dwarf_attr_name (ATTR));      \
     fputc ('\n', (FILE));                                              \
@@ -630,7 +733,7 @@ static unsigned lookup_filename ();
 #define ASM_OUTPUT_DWARF_STACK_OP(FILE,OP)                             \
   do {                                                                 \
     fprintf ((FILE), "\t%s\t0x%x", ASM_BYTE_OP, (unsigned) OP);                \
-    if (flag_verbose_asm)                                              \
+    if (flag_debug_asm)                                                        \
       fprintf ((FILE), "\t%s %s",                                      \
                       ASM_COMMENT_START, dwarf_stack_op_name (OP));    \
     fputc ('\n', (FILE));                                              \
@@ -642,7 +745,7 @@ static unsigned lookup_filename ();
   do {                                                                 \
     fprintf ((FILE), "\t%s\t0x%x",                                     \
                     UNALIGNED_SHORT_ASM_OP, (unsigned) FT);            \
-    if (flag_verbose_asm)                                              \
+    if (flag_debug_asm)                                                        \
       fprintf ((FILE), "\t%s %s",                                      \
                       ASM_COMMENT_START, dwarf_fund_type_name (FT));   \
     fputc ('\n', (FILE));                                              \
@@ -653,7 +756,7 @@ static unsigned lookup_filename ();
 #define ASM_OUTPUT_DWARF_FMT_BYTE(FILE,FMT)                            \
   do {                                                                 \
     fprintf ((FILE), "\t%s\t0x%x", ASM_BYTE_OP, (unsigned) FMT);       \
-    if (flag_verbose_asm)                                              \
+    if (flag_debug_asm)                                                        \
       fprintf ((FILE), "\t%s %s",                                      \
                       ASM_COMMENT_START, dwarf_fmt_byte_name (FMT));   \
     fputc ('\n', (FILE));                                              \
@@ -664,7 +767,7 @@ static unsigned lookup_filename ();
 #define ASM_OUTPUT_DWARF_TYPE_MODIFIER(FILE,MOD)                       \
   do {                                                                 \
     fprintf ((FILE), "\t%s\t0x%x", ASM_BYTE_OP, (unsigned) MOD);       \
-    if (flag_verbose_asm)                                              \
+    if (flag_debug_asm)                                                        \
       fprintf ((FILE), "\t%s %s",                                      \
                       ASM_COMMENT_START, dwarf_typemod_name (MOD));    \
     fputc ('\n', (FILE));                                              \
@@ -734,16 +837,6 @@ static unsigned lookup_filename ();
 \f
 /************************ general utility functions **************************/
 
-inline char *
-xstrdup (s)
-     register char *s;
-{
-  register char *p = (char *) xmalloc (strlen (s) + 1);
-
-  strcpy (p, s);
-  return p;
-}
-
 inline int
 is_pseudo_reg (rtl)
      register rtx rtl;
@@ -962,6 +1055,7 @@ dwarf_fmt_byte_name (fmt)
     default:           return "FMT_<unknown>";
     }
 }
+
 static char *
 dwarf_fund_type_name (ft)
      register unsigned ft;
@@ -1093,7 +1187,7 @@ output_unsigned_leb128 (value)
       if (value != 0)  /* more bytes to follow */
        byte |= 0x80;
       fprintf (asm_out_file, "\t%s\t0x%x", ASM_BYTE_OP, (unsigned) byte);
-      if (flag_verbose_asm && value == 0)
+      if (flag_debug_asm && value == 0)
        fprintf (asm_out_file, "\t%s ULEB128 number - value = %u",
                 ASM_COMMENT_START, orig_value);
       fputc ('\n', asm_out_file);
@@ -1125,7 +1219,7 @@ output_signed_leb128 (value)
          more = 1;
        }
       fprintf (asm_out_file, "\t%s\t0x%x", ASM_BYTE_OP, (unsigned) byte);
-      if (flag_verbose_asm && more == 0)
+      if (flag_debug_asm && more == 0)
        fprintf (asm_out_file, "\t%s SLEB128 number - value = %d",
                 ASM_COMMENT_START, orig_value);
       fputc ('\n', asm_out_file);
@@ -1147,7 +1241,7 @@ output_signed_leb128 (value)
    FUNCTION_DECL node.
 */
 
-inline int
+static inline int
 is_body_block (stmt)
      register tree stmt;
 {
@@ -1372,7 +1466,7 @@ write_modifier_bytes (type, decl_const, decl_volatile)
 /* Given a pointer to an arbitrary ..._TYPE tree node, return non-zero if the
    given input type is a Dwarf "fundamental" type.  Otherwise return zero.  */
 
-inline int
+static inline int
 type_is_fundamental (type)
      register tree type;
 {
@@ -1453,7 +1547,7 @@ equate_decl_number_to_die_number (decl)
    simply by re-generating the alternative name from the ..._TYPE node's
    UID number. */
 
-inline void
+static inline void
 equate_type_number_to_die_number (type)
      register tree type;
 {
@@ -1486,7 +1580,7 @@ output_reg_number (rtl)
     }
   fprintf (asm_out_file, "\t%s\t0x%x",
           UNALIGNED_INT_ASM_OP, DBX_REGISTER_NUMBER (regno));
-  if (flag_verbose_asm)
+  if (flag_debug_asm)
     {
       fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
       PRINT_REG (rtl, 0, asm_out_file);
@@ -1724,7 +1818,7 @@ output_enumeral_list (link)
 /* Given an unsigned value, round it up to the lowest multiple of `boundary'
    which is not less than the value itself.  */
 
-inline unsigned
+static inline unsigned
 ceiling (value, boundary)
      register unsigned value;
      register unsigned boundary;
@@ -1736,7 +1830,7 @@ ceiling (value, boundary)
    pointer to the declared type for the relevant field variable, or return
    `integer_type_node' if the given node turns out to be an ERROR_MARK node.  */
 
-inline tree
+static inline tree
 field_type (decl)
      register tree decl;
 {
@@ -1755,7 +1849,7 @@ field_type (decl)
    node, return the alignment in bits for the type, or else return
    BITS_PER_WORD if the node actually turns out to be an ERROR_MARK node.  */
 
-inline unsigned
+static inline unsigned
 simple_type_align_in_bits (type)
      register tree type;
 {
@@ -1768,7 +1862,7 @@ simple_type_align_in_bits (type)
    constant, or else return BITS_PER_WORD if the type actually turns out
    to be an ERROR_MARK node.  */
 
-inline unsigned
+static inline unsigned
 simple_type_size_in_bits (type)
      register tree type;
 {
@@ -1912,7 +2006,7 @@ field_byte_offset (decl)
 
 /* Generate an AT_sibling attribute.  */
 
-inline void
+static inline void
 sibling_attribute ()
 {
   char label[MAX_ARTIFICIAL_LABEL_BYTES];
@@ -1957,7 +2051,7 @@ location_attribute (rtl)
      suppress the generation of the entire location attribute because
      the absence of a location attribute in certain kinds of DIEs is
      used to indicate something else entirely... i.e. that the DIE
-     represents an object declaration, but not a definition.  So sayeth
+     represents an object declaration, but not a definition.  So saith
      the PLSIG.
   */
 
@@ -2204,12 +2298,10 @@ location_or_const_value_attribute (decl)
 
        if (declared_type == passed_type)
          rtl = DECL_INCOMING_RTL (decl);
-#if (BYTES_BIG_ENDIAN == 0)
-       else
+       else if (! BYTES_BIG_ENDIAN)
          if (TREE_CODE (declared_type) == INTEGER_TYPE)
            if (TYPE_SIZE (declared_type) <= TYPE_SIZE (passed_type))
              rtl = DECL_INCOMING_RTL (decl);
-#endif /* (BYTES_BIG_ENDIAN == 0) */
       }
 
   if (rtl == NULL_RTX)
@@ -2241,7 +2333,7 @@ location_or_const_value_attribute (decl)
 /* Generate an AT_name attribute given some string value to be included as
    the value of the attribute. */
 
-inline void
+static inline void
 name_attribute (name_string)
      register char *name_string;
 {
@@ -2252,7 +2344,7 @@ name_attribute (name_string)
     }
 }
 
-inline void
+static inline void
 fund_type_attribute (ft_code)
      register unsigned ft_code;
 {
@@ -2280,7 +2372,7 @@ mod_fund_type_attribute (type, decl_const, decl_volatile)
   ASM_OUTPUT_LABEL (asm_out_file, end_label);
 }
 
-inline void
+static inline void
 user_def_type_attribute (type)
      register tree type;
 {
@@ -2313,7 +2405,7 @@ mod_u_d_type_attribute (type, decl_const, decl_volatile)
 }
 
 #ifdef USE_ORDERING_ATTRIBUTE
-inline void
+static inline void
 ordering_attribute (ordering)
      register unsigned ordering;
 {
@@ -2416,7 +2508,7 @@ subscript_data_attribute (type)
        }
     }
 
-  /* Output the prefix byte that says that the element type is comming up.  */
+  /* Output the prefix byte that says that the element type is coming up.  */
 
   ASM_OUTPUT_DWARF_FMT_BYTE (asm_out_file, FMT_ET);
 
@@ -2484,10 +2576,9 @@ byte_size_attribute (tree_node)
 
    Note that it is the size (in bytes) of the hypothetical "containing
    object" which will be given in the AT_byte_size attribute for this
-   bit-field.  (See `byte_size_attribute' above.)
-*/
+   bit-field.  (See `byte_size_attribute' above.) */
 
-inline void
+static inline void
 bit_offset_attribute (decl)
     register tree decl;
 {
@@ -2519,19 +2610,18 @@ bit_offset_attribute (decl)
   highest_order_object_bit_offset = object_offset_in_bytes * BITS_PER_UNIT;
   highest_order_field_bit_offset = bitpos_int;
 
-#if (BYTES_BIG_ENDIAN == 0)
-  highest_order_field_bit_offset
-    += (unsigned) TREE_INT_CST_LOW (DECL_SIZE (decl));
+  if (! BYTES_BIG_ENDIAN)
+    {
+      highest_order_field_bit_offset
+       += (unsigned) TREE_INT_CST_LOW (DECL_SIZE (decl));
 
-  highest_order_object_bit_offset += simple_type_size_in_bits (type);
-#endif /* (BYTES_BIG_ENDIAN == 0) */
+      highest_order_object_bit_offset += simple_type_size_in_bits (type);
+    }
 
   bit_offset =
-#if (BYTES_BIG_ENDIAN == 0)
-         highest_order_object_bit_offset - highest_order_field_bit_offset;
-#else /* (BYTES_BIG_ENDIAN != 0) */
-         highest_order_field_bit_offset - highest_order_object_bit_offset;
-#endif /* (BYTES_BIG_ENDIAN != 0) */
+    (! BYTES_BIG_ENDIAN
+     ? highest_order_object_bit_offset - highest_order_field_bit_offset
+     : highest_order_field_bit_offset - highest_order_object_bit_offset);
 
   ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_bit_offset);
   ASM_OUTPUT_DWARF_DATA2 (asm_out_file, bit_offset);
@@ -2540,7 +2630,7 @@ bit_offset_attribute (decl)
 /* For a FIELD_DECL node which represents a bit field, output an attribute
    which specifies the length in bits of the given field.  */
 
-inline void
+static inline void
 bit_size_attribute (decl)
     register tree decl;
 {
@@ -2557,7 +2647,7 @@ bit_size_attribute (decl)
    all of the enumeration constants associated with the given enumeration
    type.  */
 
-inline void
+static inline void
 element_list_attribute (element)
      register tree element;
 {
@@ -2583,7 +2673,7 @@ element_list_attribute (element)
 /* Generate an AT_stmt_list attribute. These are normally present only in
    DIEs with a TAG_compile_unit tag.  */
 
-inline void
+static inline void
 stmt_list_attribute (label)
     register char *label;
 {
@@ -2595,7 +2685,7 @@ stmt_list_attribute (label)
 /* Generate an AT_low_pc attribute for a label DIE, a lexical_block DIE or
    for a subroutine DIE.  */
 
-inline void
+static inline void
 low_pc_attribute (asm_low_label)
      register char *asm_low_label;
 {
@@ -2606,7 +2696,7 @@ low_pc_attribute (asm_low_label)
 /* Generate an AT_high_pc attribute for a lexical_block DIE or for a
    subroutine DIE.  */
 
-inline void
+static inline void
 high_pc_attribute (asm_high_label)
     register char *asm_high_label;
 {
@@ -2616,7 +2706,7 @@ high_pc_attribute (asm_high_label)
 
 /* Generate an AT_body_begin attribute for a subroutine DIE.  */
 
-inline void
+static inline void
 body_begin_attribute (asm_begin_label)
      register char *asm_begin_label;
 {
@@ -2626,7 +2716,7 @@ body_begin_attribute (asm_begin_label)
 
 /* Generate an AT_body_end attribute for a subroutine DIE.  */
 
-inline void
+static inline void
 body_end_attribute (asm_end_label)
      register char *asm_end_label;
 {
@@ -2637,7 +2727,7 @@ body_end_attribute (asm_end_label)
 /* Generate an AT_language attribute given a LANG value.  These attributes
    are used only within TAG_compile_unit DIEs.  */
 
-inline void
+static inline void
 language_attribute (language_code)
      register unsigned language_code;
 {
@@ -2645,7 +2735,7 @@ language_attribute (language_code)
   ASM_OUTPUT_DWARF_DATA4 (asm_out_file, language_code);
 }
 
-inline void
+static inline void
 member_attribute (context)
     register tree context;
 {
@@ -2661,7 +2751,7 @@ member_attribute (context)
     }
 }
 
-inline void
+static inline void
 string_length_attribute (upper_bound)
      register tree upper_bound;
 {
@@ -2677,7 +2767,7 @@ string_length_attribute (upper_bound)
   ASM_OUTPUT_LABEL (asm_out_file, end_label);
 }
 
-inline void
+static inline void
 comp_dir_attribute (dirname)
      register char *dirname;
 {
@@ -2685,7 +2775,7 @@ comp_dir_attribute (dirname)
   ASM_OUTPUT_DWARF_STRING (asm_out_file, dirname);
 }
 
-inline void
+static inline void
 sf_names_attribute (sf_names_start_label)
      register char *sf_names_start_label;
 {
@@ -2694,7 +2784,7 @@ sf_names_attribute (sf_names_start_label)
   ASM_OUTPUT_DWARF_ADDR (asm_out_file, sf_names_start_label);
 }
 
-inline void
+static inline void
 src_info_attribute (src_info_start_label)
      register char *src_info_start_label;
 {
@@ -2703,7 +2793,7 @@ src_info_attribute (src_info_start_label)
   ASM_OUTPUT_DWARF_ADDR (asm_out_file, src_info_start_label);
 }
 
-inline void
+static inline void
 mac_info_attribute (mac_info_start_label)
      register char *mac_info_start_label;
 {
@@ -2712,7 +2802,7 @@ mac_info_attribute (mac_info_start_label)
   ASM_OUTPUT_DWARF_ADDR (asm_out_file, mac_info_start_label);
 }
 
-inline void
+static inline void
 prototyped_attribute (func_type)
      register tree func_type;
 {
@@ -2724,7 +2814,7 @@ prototyped_attribute (func_type)
     }
 }
 
-inline void
+static inline void
 producer_attribute (producer)
      register char *producer;
 {
@@ -2732,7 +2822,7 @@ producer_attribute (producer)
   ASM_OUTPUT_DWARF_STRING (asm_out_file, producer);
 }
 
-inline void
+static inline void
 inline_attribute (decl)
      register tree decl;
 {
@@ -2743,7 +2833,7 @@ inline_attribute (decl)
     }
 }
 
-inline void
+static inline void
 containing_type_attribute (containing_type)
      register tree containing_type;
 {
@@ -2754,7 +2844,7 @@ containing_type_attribute (containing_type)
   ASM_OUTPUT_DWARF_REF (asm_out_file, label);
 }
 
-inline void
+static inline void
 abstract_origin_attribute (origin)
      register tree origin;
 {
@@ -2779,7 +2869,7 @@ abstract_origin_attribute (origin)
 }
 
 #ifdef DWARF_DECL_COORDINATES
-inline void
+static inline void
 src_coords_attribute (src_fileno, src_lineno)
      register unsigned src_fileno;
      register unsigned src_lineno;
@@ -2790,7 +2880,7 @@ src_coords_attribute (src_fileno, src_lineno)
 }
 #endif /* defined(DWARF_DECL_COORDINATES) */
 
-inline void
+static inline void
 pure_or_virtual_attribute (func_decl)
      register tree func_decl;
 {
@@ -2937,7 +3027,7 @@ type_tag (type)
   return (name == 0 || *name == '\0') ? 0 : name;
 }
 
-inline void
+static inline void
 dienum_push ()
 {
   /* Start by checking if the pending_sibling_stack needs to be expanded.
@@ -2958,13 +3048,13 @@ dienum_push ()
 /* Pop the sibling stack so that the most recently pushed DIEnum becomes the
    NEXT_DIE_NUM.  */
 
-inline void
+static inline void
 dienum_pop ()
 {
   pending_siblings--;
 }
 
-inline tree
+static inline tree
 member_declared_type (member)
      register tree member;
 {
@@ -3465,6 +3555,8 @@ output_compile_unit_die (arg)
     language_attribute (LANG_C_PLUS_PLUS);
   else if (strcmp (language_string, "GNU Ada") == 0)
     language_attribute (LANG_ADA83);
+  else if (strcmp (language_string, "GNU F77") == 0)
+    language_attribute (LANG_FORTRAN77);
   else if (flag_traditional)
     language_attribute (LANG_C);
   else
@@ -3859,10 +3951,9 @@ pend_type (type)
    been output are instead placed onto the pending_types_list.  Later on,
    we force these (temporarily pended) types to be output simply by calling
    `output_pending_types_for_scope' with an actual argument equal to the
-   true scope of the types we temporarily pended.
-*/
+   true scope of the types we temporarily pended.  */
 
-inline int
+static inline int
 type_ok_for_scope (type, scope)
     register tree type;
     register tree scope;
@@ -3892,8 +3983,7 @@ type_ok_for_scope (type, scope)
    Note that we have to process the list in beginning-to-end order,
    because the call made here to output_type may cause yet more types
    to be added to the end of the list, and we may have to output some
-   of them too.
-*/
+   of them too. */
 
 static void
 output_pending_types_for_scope (containing_scope)
@@ -4362,6 +4452,17 @@ output_decl (decl, containing_scope)
   if (TREE_CODE (decl) == ERROR_MARK)
     return;
 
+  /* If a structure is declared within an initialization, e.g. as the
+     operand of a sizeof, then it will not have a name.  We don't want
+     to output a DIE for it, as the tree nodes are in the temporary obstack */
+
+  if ((TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE
+       || TREE_CODE (TREE_TYPE (decl)) == UNION_TYPE)
+      && ((DECL_NAME (decl) == 0 && TYPE_NAME (TREE_TYPE (decl)) == 0)
+         || (TYPE_FIELDS (TREE_TYPE (decl)) 
+             && (TREE_CODE (TYPE_FIELDS (TREE_TYPE (decl))) == ERROR_MARK))))
+    return;
+  
   /* If this ..._DECL node is marked to be ignored, then ignore it.
      But don't ignore a function definition, since that would screw
      up our count of blocks, and that it turn will completely screw up the
@@ -4516,7 +4617,7 @@ output_decl (decl, containing_scope)
               }
             else
               {
-             /* this is unprotoyped, check for undefined (just declaration) */
+             /* this is unprototyped, check for undefined (just declaration) */
               if (!DECL_INITIAL (decl))
                 output_die (output_unspecified_parameters_die, decl);
               }
@@ -4547,7 +4648,7 @@ output_decl (decl, containing_scope)
 
               Just within the `outer_scope' there will be another BLOCK
               node representing the function's outermost pair of curly
-              braces.  We musn't generate a lexical_block DIE for this
+              braces.  We mustn't generate a lexical_block DIE for this
               outermost pair of curly braces because that is not really an
               independent scope according to ANSI C rules.  Rather, it is
               the same scope in which the parameters were declared.  */
@@ -4748,12 +4849,12 @@ dwarfout_file_scope_decl (decl, set_finalizing)
       /* What we would really like to do here is to filter out all mere
         file-scope declarations of file-scope functions which are never
         referenced later within this translation unit (and keep all of
-        ones that *are* referenced later on) but we aren't clarvoiant,
+        ones that *are* referenced later on) but we aren't clairvoyant,
         so we have no idea which functions will be referenced in the
         future (i.e. later on within the current translation unit).
         So here we just ignore all file-scope function declarations
         which are not also definitions.  If and when the debugger needs
-        to know something about these funcstion, it wil have to hunt
+        to know something about these functions, it wil have to hunt
         around and find the DWARF information associated with the
         *definition* of the function.
 
@@ -4926,7 +5027,7 @@ dwarfout_begin_block (blocknum)
 {
   char label[MAX_ARTIFICIAL_LABEL_BYTES];
 
-  text_section ();
+  function_section (current_function_decl);
   sprintf (label, BLOCK_BEGIN_LABEL_FMT, blocknum);
   ASM_OUTPUT_LABEL (asm_out_file, label);
 }
@@ -4940,7 +5041,7 @@ dwarfout_end_block (blocknum)
 {
   char label[MAX_ARTIFICIAL_LABEL_BYTES];
 
-  text_section ();
+  function_section (current_function_decl);
   sprintf (label, BLOCK_END_LABEL_FMT, blocknum);
   ASM_OUTPUT_LABEL (asm_out_file, label);
 }
@@ -4956,7 +5057,7 @@ dwarfout_label (insn)
     {
       char label[MAX_ARTIFICIAL_LABEL_BYTES];
 
-      text_section ();
+      function_section (current_function_decl);
       sprintf (label, INSN_LABEL_FMT, current_funcdef_number,
                                      (unsigned) INSN_UID (insn));
       ASM_OUTPUT_LABEL (asm_out_file, label);
@@ -4972,7 +5073,7 @@ dwarfout_begin_function ()
 {
   char label[MAX_ARTIFICIAL_LABEL_BYTES];
 
-  text_section ();
+  function_section (current_function_decl);
   sprintf (label, BODY_BEGIN_LABEL_FMT, current_funcdef_number);
   ASM_OUTPUT_LABEL (asm_out_file, label);
 }
@@ -4985,7 +5086,7 @@ dwarfout_end_function ()
 {
   char label[MAX_ARTIFICIAL_LABEL_BYTES];
 
-  text_section ();
+  function_section (current_function_decl);
   sprintf (label, BODY_END_LABEL_FMT, current_funcdef_number);
   ASM_OUTPUT_LABEL (asm_out_file, label);
 }
@@ -5077,8 +5178,7 @@ generate_new_sfname_entry ()
    calculated, and where at least one of the two symbol references is a
    forward reference.  (This bug could be tickled by our .debug_srcinfo
    entries if we don't output their corresponding .debug_sfnames entries
-   before them.)
-*/
+   before them.) */
 
 static unsigned
 lookup_filename (file_name)
@@ -5159,7 +5259,7 @@ dwarfout_line (filename, line)
       static unsigned prev_file_entry_num = (unsigned) -1;
       register unsigned this_file_entry_num = lookup_filename (filename);
 
-      text_section ();
+      function_section (current_function_decl);
       sprintf (label, LINE_CODE_LABEL_FMT, ++last_line_entry_num);
       ASM_OUTPUT_LABEL (asm_out_file, label);