OSDN Git Service

Fix PR c++/43704
[pf3gnuchains/gcc-fork.git] / gcc / dbxout.c
index c94e6f9..a314e7b 100644 (file)
@@ -1,6 +1,6 @@
 /* Output dbx-format symbol table information from GNU compiler.
    Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
 /* Output dbx-format symbol table information from GNU compiler.
    Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
 This file is part of GCC.
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -171,8 +171,7 @@ enum typestatus {TYPE_UNSEEN, TYPE_XREF, TYPE_DEFINED};
    The file_number and type_number elements are used if DBX_USE_BINCL
    is defined.  */
 
    The file_number and type_number elements are used if DBX_USE_BINCL
    is defined.  */
 
-struct typeinfo GTY(())
-{
+struct GTY(()) typeinfo {
   enum typestatus status;
   int file_number;
   int type_number;
   enum typestatus status;
   int file_number;
   int type_number;
@@ -217,8 +216,8 @@ struct dbx_file
   struct dbx_file *prev;          /* Chain to traverse all pending bincls.  */
 };
 
   struct dbx_file *prev;          /* Chain to traverse all pending bincls.  */
 };
 
-/* This is the top of the stack.  
-   
+/* This is the top of the stack.
+
    This is not saved for PCH, because restoring a PCH should not change it.
    next_file_number does have to be saved, because the PCH may use some
    file numbers; however, just before restoring a PCH, next_file_number
    This is not saved for PCH, because restoring a PCH should not change it.
    next_file_number does have to be saved, because the PCH may use some
    file numbers; however, just before restoring a PCH, next_file_number
@@ -276,8 +275,6 @@ static const char *base_input_file;
 
 #include "gstab.h"
 
 
 #include "gstab.h"
 
-#define STAB_CODE_TYPE enum __stab_debug_code
-
 /* 1 if PARM is passed to this function in memory.  */
 
 #define PARM_PASSED_IN_MEMORY(PARM) \
 /* 1 if PARM is passed to this function in memory.  */
 
 #define PARM_PASSED_IN_MEMORY(PARM) \
@@ -309,7 +306,7 @@ static void emit_pending_bincls         (void);
 static inline void emit_pending_bincls_if_required (void);
 
 static void dbxout_init (const char *);
 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_finish (const char *);
 static void dbxout_start_source_file (unsigned, const char *);
 static void dbxout_end_source_file (unsigned);
@@ -319,15 +316,15 @@ static void dbxout_args (tree);
 static void dbxout_type_fields (tree);
 static void dbxout_type_method_1 (tree);
 static void dbxout_type_methods (tree);
 static void dbxout_type_fields (tree);
 static void dbxout_type_method_1 (tree);
 static void dbxout_type_methods (tree);
-static void dbxout_range_type (tree);
+static void dbxout_range_type (tree, tree, tree);
 static void dbxout_type (tree, int);
 static void dbxout_type (tree, int);
-static bool print_int_cst_bounds_in_octal_p (tree);
+static bool print_int_cst_bounds_in_octal_p (tree, tree, tree);
 static bool is_fortran (void);
 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 bool is_fortran (void);
 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_common_name (tree, const char *, STAB_CODE_TYPE);
+static void dbxout_common_name (tree, const char *, stab_code_type);
 static const char *dbxout_common_check (tree, int *);
 static void dbxout_global_decl (tree);
 static void dbxout_type_decl (tree, int);
 static const char *dbxout_common_check (tree, int *);
 static void dbxout_global_decl (tree);
 static void dbxout_type_decl (tree, int);
@@ -336,7 +333,7 @@ static void dbxout_handle_pch (unsigned);
 /* The debug hooks structure.  */
 #if defined (DBX_DEBUGGING_INFO)
 
 /* The debug hooks structure.  */
 #if defined (DBX_DEBUGGING_INFO)
 
-static void dbxout_source_line (unsigned int, const char *);
+static void dbxout_source_line (unsigned int, const char *, int, bool);
 static void dbxout_begin_prologue (unsigned int, const char *);
 static void dbxout_source_file (const char *);
 static void dbxout_function_end (tree);
 static void dbxout_begin_prologue (unsigned int, const char *);
 static void dbxout_source_file (const char *);
 static void dbxout_function_end (tree);
@@ -349,6 +346,7 @@ const struct gcc_debug_hooks dbx_debug_hooks =
 {
   dbxout_init,
   dbxout_finish,
 {
   dbxout_init,
   dbxout_finish,
+  debug_nothing_void,
   debug_nothing_int_charstar,
   debug_nothing_int_charstar,
   dbxout_start_source_file,
   debug_nothing_int_charstar,
   debug_nothing_int_charstar,
   dbxout_start_source_file,
@@ -369,13 +367,18 @@ const struct gcc_debug_hooks dbx_debug_hooks =
   dbxout_function_decl,
   dbxout_global_decl,                   /* global_decl */
   dbxout_type_decl,                     /* type_decl */
   dbxout_function_decl,
   dbxout_global_decl,                   /* global_decl */
   dbxout_type_decl,                     /* type_decl */
-  debug_nothing_tree_tree,               /* imported_module_or_decl */
+  debug_nothing_tree_tree_tree_bool,    /* imported_module_or_decl */
   debug_nothing_tree,                   /* deferred_inline_function */
   debug_nothing_tree,                   /* outlining_inline_function */
   debug_nothing_rtx,                    /* label */
   dbxout_handle_pch,                    /* handle_pch */
   debug_nothing_rtx,                    /* var_location */
   debug_nothing_void,                    /* switch_text_section */
   debug_nothing_tree,                   /* deferred_inline_function */
   debug_nothing_tree,                   /* outlining_inline_function */
   debug_nothing_rtx,                    /* label */
   dbxout_handle_pch,                    /* handle_pch */
   debug_nothing_rtx,                    /* var_location */
   debug_nothing_void,                    /* switch_text_section */
+  debug_nothing_tree,                   /* direct_call */
+  debug_nothing_tree_int,               /* virtual_call_token */
+  debug_nothing_rtx_rtx,                /* copy_call_info */
+  debug_nothing_uid,                    /* virtual_call */
+  debug_nothing_tree_tree,              /* set_name */
   0                                      /* start_end_main_source_file */
 };
 #endif /* DBX_DEBUGGING_INFO  */
   0                                      /* start_end_main_source_file */
 };
 #endif /* DBX_DEBUGGING_INFO  */
@@ -385,6 +388,7 @@ const struct gcc_debug_hooks xcoff_debug_hooks =
 {
   dbxout_init,
   dbxout_finish,
 {
   dbxout_init,
   dbxout_finish,
+  debug_nothing_void,
   debug_nothing_int_charstar,
   debug_nothing_int_charstar,
   dbxout_start_source_file,
   debug_nothing_int_charstar,
   debug_nothing_int_charstar,
   dbxout_start_source_file,
@@ -401,13 +405,18 @@ const struct gcc_debug_hooks xcoff_debug_hooks =
   debug_nothing_tree,                   /* function_decl */
   dbxout_global_decl,                   /* global_decl */
   dbxout_type_decl,                     /* type_decl */
   debug_nothing_tree,                   /* function_decl */
   dbxout_global_decl,                   /* global_decl */
   dbxout_type_decl,                     /* type_decl */
-  debug_nothing_tree_tree,               /* imported_module_or_decl */
+  debug_nothing_tree_tree_tree_bool,    /* imported_module_or_decl */
   debug_nothing_tree,                   /* deferred_inline_function */
   debug_nothing_tree,                   /* outlining_inline_function */
   debug_nothing_rtx,                    /* label */
   dbxout_handle_pch,                    /* handle_pch */
   debug_nothing_rtx,                    /* var_location */
   debug_nothing_void,                    /* switch_text_section */
   debug_nothing_tree,                   /* deferred_inline_function */
   debug_nothing_tree,                   /* outlining_inline_function */
   debug_nothing_rtx,                    /* label */
   dbxout_handle_pch,                    /* handle_pch */
   debug_nothing_rtx,                    /* var_location */
   debug_nothing_void,                    /* switch_text_section */
+  debug_nothing_tree,                   /* direct_call */
+  debug_nothing_tree_int,               /* virtual_call_token */
+  debug_nothing_rtx_rtx,                /* copy_call_info */
+  debug_nothing_uid,                    /* virtual_call */
+  debug_nothing_tree_tree,              /* set_name */
   0                                      /* start_end_main_source_file */
 };
 #endif /* XCOFF_DEBUGGING_INFO  */
   0                                      /* start_end_main_source_file */
 };
 #endif /* XCOFF_DEBUGGING_INFO  */
@@ -839,9 +848,9 @@ do {                                                                \
    SYM is the DECL of the symbol under consideration; it is used only
    for its DECL_SOURCE_LINE.  The other arguments are all passed directly
    to DBX_FINISH_STABS; see above for details.  */
    SYM is the DECL of the symbol under consideration; it is used only
    for its DECL_SOURCE_LINE.  The other arguments are all passed directly
    to DBX_FINISH_STABS; see above for details.  */
-   
+
 static void
 static void
-dbxout_finish_complex_stabs (tree sym, STAB_CODE_TYPE code,
+dbxout_finish_complex_stabs (tree sym, stab_code_type code,
                             rtx addr, const char *label, int number)
 {
   int line ATTRIBUTE_UNUSED;
                             rtx addr, const char *label, int number)
 {
   int line ATTRIBUTE_UNUSED;
@@ -893,7 +902,7 @@ dbxout_finish_complex_stabs (tree sym, STAB_CODE_TYPE code,
       obstack_grow (&stabstr_ob, "\",", 2);
       len = obstack_object_size (&stabstr_ob);
       str = XOBFINISH (&stabstr_ob, char *);
       obstack_grow (&stabstr_ob, "\",", 2);
       len = obstack_object_size (&stabstr_ob);
       str = XOBFINISH (&stabstr_ob, char *);
-      
+
       fwrite (str, 1, len, asm_out_file);
       DBX_FINISH_STABS (sym, code, line, addr, label, number);
     }
       fwrite (str, 1, len, asm_out_file);
       DBX_FINISH_STABS (sym, code, line, addr, label, number);
     }
@@ -903,14 +912,14 @@ dbxout_finish_complex_stabs (tree sym, STAB_CODE_TYPE code,
 #if defined (DBX_DEBUGGING_INFO)
 
 static void
 #if defined (DBX_DEBUGGING_INFO)
 
 static void
-dbxout_function_end (tree decl)
+dbxout_function_end (tree decl ATTRIBUTE_UNUSED)
 {
   char lscope_label_name[100];
 
   /* The Lscope label must be emitted even if we aren't doing anything
      else; dbxout_block needs it.  */
   switch_to_section (function_section (current_function_decl));
 {
   char lscope_label_name[100];
 
   /* The Lscope label must be emitted even if we aren't doing anything
      else; dbxout_block needs it.  */
   switch_to_section (function_section (current_function_decl));
-  
+
   /* Convert Lscope into the appropriate format for local labels in case
      the system doesn't insert underscores in front of user generated
      labels.  */
   /* Convert Lscope into the appropriate format for local labels in case
      the system doesn't insert underscores in front of user generated
      labels.  */
@@ -922,8 +931,7 @@ dbxout_function_end (tree decl)
      named sections.  */
   if (!use_gnu_debug_info_extensions
       || NO_DBX_FUNCTION_END
      named sections.  */
   if (!use_gnu_debug_info_extensions
       || NO_DBX_FUNCTION_END
-      || !targetm.have_named_sections
-      || DECL_IGNORED_P (decl))
+      || !targetm.have_named_sections)
     return;
 
   /* By convention, GCC will mark the end of a function with an N_FUN
     return;
 
   /* By convention, GCC will mark the end of a function with an N_FUN
@@ -931,11 +939,11 @@ dbxout_function_end (tree decl)
   if (flag_reorder_blocks_and_partition)
     {
       dbxout_begin_empty_stabs (N_FUN);
   if (flag_reorder_blocks_and_partition)
     {
       dbxout_begin_empty_stabs (N_FUN);
-      dbxout_stab_value_label_diff (cfun->hot_section_end_label, 
-                                   cfun->hot_section_label);
+      dbxout_stab_value_label_diff (crtl->subsections.hot_section_end_label,
+                                   crtl->subsections.hot_section_label);
       dbxout_begin_empty_stabs (N_FUN);
       dbxout_begin_empty_stabs (N_FUN);
-      dbxout_stab_value_label_diff (cfun->cold_section_end_label, 
-                                   cfun->cold_section_label);
+      dbxout_stab_value_label_diff (crtl->subsections.cold_section_end_label,
+                                   crtl->subsections.cold_section_label);
     }
   else
     {
     }
   else
     {
@@ -996,7 +1004,7 @@ dbxout_init (const char *input_file_name)
   const char *mapped_name;
 
   typevec_len = 100;
   const char *mapped_name;
 
   typevec_len = 100;
-  typevec = ggc_calloc (typevec_len, sizeof typevec[0]);
+  typevec = GGC_CNEWVEC (struct typeinfo, typevec_len);
 
   /* stabstr_ob contains one string, which will be just fine with
      1-byte alignment.  */
 
   /* stabstr_ob contains one string, which will be just fine with
      1-byte alignment.  */
@@ -1170,7 +1178,7 @@ dbxout_start_source_file (unsigned int line ATTRIBUTE_UNUSED,
 
   n->next = current_file;
   n->next_type_number = 1;
 
   n->next = current_file;
   n->next_type_number = 1;
-  /* Do not assign file number now. 
+  /* Do not assign file number now.
      Delay it until we actually emit BINCL.  */
   n->file_number = 0;
   n->prev = NULL;
      Delay it until we actually emit BINCL.  */
   n->file_number = 0;
   n->prev = NULL;
@@ -1251,7 +1259,7 @@ dbxout_source_file (const char *filename)
     }
 }
 
     }
 }
 
-/* Output N_BNSYM, line number symbol entry, and local symbol at 
+/* Output N_BNSYM, line number symbol entry, and local symbol at
    function scope  */
 
 static void
    function scope  */
 
 static void
@@ -1266,8 +1274,8 @@ dbxout_begin_prologue (unsigned int lineno, const char *filename)
   /* pre-increment the scope counter */
   scope_labelno++;
 
   /* pre-increment the scope counter */
   scope_labelno++;
 
-  dbxout_source_line (lineno, filename);
-  /* Output function begin block at function scope, referenced 
+  dbxout_source_line (lineno, filename, 0, true);
+  /* Output function begin block at function scope, referenced
      by dbxout_block, dbxout_source_line and dbxout_function_end.  */
   emit_pending_bincls_if_required ();
   targetm.asm_out.internal_label (asm_out_file, "LFBB", scope_labelno);
      by dbxout_block, dbxout_source_line and dbxout_function_end.  */
   emit_pending_bincls_if_required ();
   targetm.asm_out.internal_label (asm_out_file, "LFBB", scope_labelno);
@@ -1277,7 +1285,9 @@ dbxout_begin_prologue (unsigned int lineno, const char *filename)
    number LINENO.  */
 
 static void
    number LINENO.  */
 
 static void
-dbxout_source_line (unsigned int lineno, const char *filename)
+dbxout_source_line (unsigned int lineno, const char *filename,
+                    int discriminator ATTRIBUTE_UNUSED,
+                    bool is_stmt ATTRIBUTE_UNUSED)
 {
   dbxout_source_file (filename);
 
 {
   dbxout_source_file (filename);
 
@@ -1289,7 +1299,7 @@ dbxout_source_line (unsigned int lineno, const char *filename)
       char begin_label[20];
       dbxout_begin_stabn_sline (lineno);
       /* Reference current function start using LFBB.  */
       char begin_label[20];
       dbxout_begin_stabn_sline (lineno);
       /* Reference current function start using LFBB.  */
-      ASM_GENERATE_INTERNAL_LABEL (begin_label, "LFBB", scope_labelno); 
+      ASM_GENERATE_INTERNAL_LABEL (begin_label, "LFBB", scope_labelno);
       dbxout_stab_value_internal_label_diff ("LM", &dbxout_source_line_counter,
                                             begin_label);
     }
       dbxout_stab_value_internal_label_diff ("LM", &dbxout_source_line_counter,
                                             begin_label);
     }
@@ -1592,10 +1602,10 @@ dbxout_type_methods (tree type)
 
 /* Emit a "range" type specification, which has the form:
    "r<index type>;<lower bound>;<upper bound>;".
 
 /* Emit a "range" type specification, which has the form:
    "r<index type>;<lower bound>;<upper bound>;".
-   TYPE is an INTEGER_TYPE.  */
+   TYPE is an INTEGER_TYPE, LOW and HIGH are the bounds.  */
 
 static void
 
 static void
-dbxout_range_type (tree type)
+dbxout_range_type (tree type, tree low, tree high)
 {
   stabstr_C ('r');
   if (TREE_TYPE (type))
 {
   stabstr_C ('r');
   if (TREE_TYPE (type))
@@ -1623,25 +1633,23 @@ dbxout_range_type (tree type)
     }
 
   stabstr_C (';');
     }
 
   stabstr_C (';');
-  if (TYPE_MIN_VALUE (type) != 0
-      && host_integerp (TYPE_MIN_VALUE (type), 0))
+  if (low && host_integerp (low, 0))
     {
     {
-      if (print_int_cst_bounds_in_octal_p (type))
-        stabstr_O (TYPE_MIN_VALUE (type));
+      if (print_int_cst_bounds_in_octal_p (type, low, high))
+        stabstr_O (low);
       else
       else
-        stabstr_D (tree_low_cst (TYPE_MIN_VALUE (type), 0));
+        stabstr_D (tree_low_cst (low, 0));
     }
   else
     stabstr_C ('0');
 
   stabstr_C (';');
     }
   else
     stabstr_C ('0');
 
   stabstr_C (';');
-  if (TYPE_MAX_VALUE (type) != 0
-      && host_integerp (TYPE_MAX_VALUE (type), 0))
+  if (high && host_integerp (high, 0))
     {
     {
-      if (print_int_cst_bounds_in_octal_p (type))
-        stabstr_O (TYPE_MAX_VALUE (type));
+      if (print_int_cst_bounds_in_octal_p (type, low, high))
+        stabstr_O (high);
       else
       else
-        stabstr_D (tree_low_cst (TYPE_MAX_VALUE (type), 0));
+        stabstr_D (tree_low_cst (high, 0));
       stabstr_C (';');
     }
   else
       stabstr_C (';');
     }
   else
@@ -1662,10 +1670,9 @@ dbxout_range_type (tree type)
 static void
 dbxout_type (tree type, int full)
 {
 static void
 dbxout_type (tree type, int full)
 {
-  tree tem;
-  tree main_variant;
   static int anonymous_type_number = 0;
   bool vector_type = false;
   static int anonymous_type_number = 0;
   bool vector_type = false;
+  tree tem, main_variant, low, high;
 
   if (TREE_CODE (type) == VECTOR_TYPE)
     {
 
   if (TREE_CODE (type) == VECTOR_TYPE)
     {
@@ -1675,6 +1682,27 @@ dbxout_type (tree type, int full)
       vector_type = true;
     }
 
       vector_type = true;
     }
 
+  if (TREE_CODE (type) == INTEGER_TYPE)
+    {
+      if (TREE_TYPE (type) == 0)
+       {
+         low = TYPE_MIN_VALUE (type);
+         high = TYPE_MAX_VALUE (type);
+       }
+
+      else if (subrange_type_for_debug_p (type, &low, &high))
+       ;
+
+      /* If this is a subtype that should not be emitted as a subrange type,
+        use the base type.  */
+      else
+       {
+         type = TREE_TYPE (type);
+         low = TYPE_MIN_VALUE (type);
+         high = TYPE_MAX_VALUE (type);
+       }
+    }
+
   /* If there was an input error and we don't really have a type,
      avoid crashing and write something that is at least valid
      by assuming `int'.  */
   /* If there was an input error and we don't really have a type,
      avoid crashing and write something that is at least valid
      by assuming `int'.  */
@@ -1709,8 +1737,7 @@ dbxout_type (tree type, int full)
 
       if (next_type_number == typevec_len)
        {
 
       if (next_type_number == typevec_len)
        {
-         typevec
-           = ggc_realloc (typevec, (typevec_len * 2 * sizeof typevec[0]));
+         typevec = GGC_RESIZEVEC (struct typeinfo, typevec, typevec_len * 2);
          memset (typevec + typevec_len, 0, typevec_len * sizeof typevec[0]);
          typevec_len *= 2;
        }
          memset (typevec + typevec_len, 0, typevec_len * sizeof typevec[0]);
          typevec_len *= 2;
        }
@@ -1877,7 +1904,7 @@ dbxout_type (tree type, int full)
              stabstr_C (';');
            }
 
              stabstr_C (';');
            }
 
-         dbxout_range_type (type);
+         dbxout_range_type (type, low, high);
        }
 
       else
        }
 
       else
@@ -1893,7 +1920,7 @@ dbxout_type (tree type, int full)
              stabstr_C (';');
            }
 
              stabstr_C (';');
            }
 
-         if (print_int_cst_bounds_in_octal_p (type))
+         if (print_int_cst_bounds_in_octal_p (type, low, high))
            {
              stabstr_C ('r');
 
            {
              stabstr_C ('r');
 
@@ -1908,15 +1935,15 @@ dbxout_type (tree type, int full)
                 dbxout_type_index (type);
 
              stabstr_C (';');
                 dbxout_type_index (type);
 
              stabstr_C (';');
-             stabstr_O (TYPE_MIN_VALUE (type));
+             stabstr_O (low);
              stabstr_C (';');
              stabstr_C (';');
-             stabstr_O (TYPE_MAX_VALUE (type));
+             stabstr_O (high);
              stabstr_C (';');
            }
 
          else
            /* Output other integer types as subranges of `int'.  */
              stabstr_C (';');
            }
 
          else
            /* Output other integer types as subranges of `int'.  */
-           dbxout_range_type (type);
+           dbxout_range_type (type, low, high);
        }
 
       break;
        }
 
       break;
@@ -2010,7 +2037,7 @@ dbxout_type (tree type, int full)
       else
        {
          stabstr_C ('a');
       else
        {
          stabstr_C ('a');
-         dbxout_range_type (tem);
+         dbxout_range_type (tem, TYPE_MIN_VALUE (tem), TYPE_MAX_VALUE (tem));
        }
 
       dbxout_type (TREE_TYPE (type), 0);
        }
 
       dbxout_type (TREE_TYPE (type), 0);
@@ -2066,7 +2093,7 @@ dbxout_type (tree type, int full)
            int i;
            tree child;
            VEC(tree,gc) *accesses = BINFO_BASE_ACCESSES (binfo);
            int i;
            tree child;
            VEC(tree,gc) *accesses = BINFO_BASE_ACCESSES (binfo);
-           
+
            if (use_gnu_debug_info_extensions)
              {
                if (BINFO_N_BASE_BINFOS (binfo))
            if (use_gnu_debug_info_extensions)
              {
                if (BINFO_N_BASE_BINFOS (binfo))
@@ -2175,16 +2202,21 @@ dbxout_type (tree type, int full)
       stabstr_C ('e');
       for (tem = TYPE_VALUES (type); tem; tem = TREE_CHAIN (tem))
        {
       stabstr_C ('e');
       for (tem = TYPE_VALUES (type); tem; tem = TREE_CHAIN (tem))
        {
+          tree value = TREE_VALUE (tem);
+
          stabstr_I (TREE_PURPOSE (tem));
          stabstr_C (':');
 
          stabstr_I (TREE_PURPOSE (tem));
          stabstr_C (':');
 
-         if (TREE_INT_CST_HIGH (TREE_VALUE (tem)) == 0)
-           stabstr_D (TREE_INT_CST_LOW (TREE_VALUE (tem)));
-         else if (TREE_INT_CST_HIGH (TREE_VALUE (tem)) == -1
-                  && (HOST_WIDE_INT) TREE_INT_CST_LOW (TREE_VALUE (tem)) < 0)
-           stabstr_D (TREE_INT_CST_LOW (TREE_VALUE (tem)));
+          if (TREE_CODE (value) == CONST_DECL)
+            value = DECL_INITIAL (value);
+
+         if (TREE_INT_CST_HIGH (value) == 0)
+           stabstr_D (TREE_INT_CST_LOW (value));
+         else if (TREE_INT_CST_HIGH (value) == -1
+                  && (HOST_WIDE_INT) TREE_INT_CST_LOW (value) < 0)
+           stabstr_D (TREE_INT_CST_LOW (value));
          else
          else
-           stabstr_O (TREE_VALUE (tem));
+           stabstr_O (value);
 
          stabstr_C (',');
          if (TREE_CHAIN (tem) != 0)
 
          stabstr_C (',');
          if (TREE_CHAIN (tem) != 0)
@@ -2253,7 +2285,7 @@ dbxout_type (tree type, int full)
    should be printed in octal format.  */
 
 static bool
    should be printed in octal format.  */
 
 static bool
-print_int_cst_bounds_in_octal_p (tree type)
+print_int_cst_bounds_in_octal_p (tree type, tree low, tree high)
 {
   /* 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
 {
   /* 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
@@ -2267,10 +2299,8 @@ print_int_cst_bounds_in_octal_p (tree type)
      can't span same size unsigned types.  */
 
   if (use_gnu_debug_info_extensions
      can't span same size unsigned types.  */
 
   if (use_gnu_debug_info_extensions
-      && TYPE_MIN_VALUE (type) != 0
-      && TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST
-      && TYPE_MAX_VALUE (type) != 0
-      && TREE_CODE (TYPE_MAX_VALUE (type)) == INTEGER_CST
+      && low && TREE_CODE (low) == INTEGER_CST
+      && high && TREE_CODE (high) == INTEGER_CST
       && (TYPE_PRECISION (type) > TYPE_PRECISION (integer_type_node)
          || ((TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node))
              && TYPE_UNSIGNED (type))
       && (TYPE_PRECISION (type) > TYPE_PRECISION (integer_type_node)
          || ((TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node))
              && TYPE_UNSIGNED (type))
@@ -2290,7 +2320,7 @@ static void
 dbxout_type_name (tree type)
 {
   tree t = TYPE_NAME (type);
 dbxout_type_name (tree type)
 {
   tree t = TYPE_NAME (type);
-  
+
   gcc_assert (t);
   switch (TREE_CODE (t))
     {
   gcc_assert (t);
   switch (TREE_CODE (t))
     {
@@ -2334,7 +2364,7 @@ dbxout_class_name_qualifiers (tree decl)
 \f
 /* This is a specialized subset of expand_expr for use by dbxout_symbol in
    evaluating DECL_VALUE_EXPR.  In particular, we stop if we find decls that
 \f
 /* This is a specialized subset of expand_expr for use by dbxout_symbol in
    evaluating DECL_VALUE_EXPR.  In particular, we stop if we find decls that
-   havn't been expanded, or if the expression is getting so complex we won't
+   haven't been expanded, or if the expression is getting so complex we won't
    be able to represent it in stabs anyway.  Returns NULL on failure.  */
 
 static rtx
    be able to represent it in stabs anyway.  Returns NULL on failure.  */
 
 static rtx
@@ -2404,8 +2434,8 @@ dbxout_expand_expr (tree expr)
 static int
 output_used_types_helper (void **slot, void *data)
 {
 static int
 output_used_types_helper (void **slot, void *data)
 {
-  tree type = *slot;
-  VEC(tree, heap) **types_p = data;
+  tree type = (tree) *slot;
+  VEC(tree, heap) **types_p = (VEC(tree, heap) **) data;
 
   if ((TREE_CODE (type) == RECORD_TYPE
        || TREE_CODE (type) == UNION_TYPE
 
   if ((TREE_CODE (type) == RECORD_TYPE
        || TREE_CODE (type) == UNION_TYPE
@@ -2500,7 +2530,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
 
   /* If we are to generate only the symbols actually used then such
      symbol nodes are flagged with TREE_USED.  Ignore any that
 
   /* If we are to generate only the symbols actually used then such
      symbol nodes are flagged with TREE_USED.  Ignore any that
-     aren't flaged as TREE_USED.  */
+     aren't flagged as TREE_USED.  */
 
   if (flag_debug_only_used_symbols
       && (!TREE_USED (decl)
 
   if (flag_debug_only_used_symbols
       && (!TREE_USED (decl)
@@ -2757,9 +2787,15 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
       }
 
     case PARM_DECL:
       }
 
     case PARM_DECL:
-      /* Parm decls go in their own separate chains
-        and are output by dbxout_reg_parms and dbxout_parms.  */
-      gcc_unreachable ();
+      if (DECL_HAS_VALUE_EXPR_P (decl))
+       decl = DECL_VALUE_EXPR (decl);
+
+      /* PARM_DECLs go in their own separate chain and are output by
+        dbxout_reg_parms and dbxout_parms, except for those that are
+        disguised VAR_DECLs like Out parameters in Ada.  */
+      gcc_assert (TREE_CODE (decl) == VAR_DECL);
+
+      /* ... fall through ...  */
 
     case RESULT_DECL:
     case VAR_DECL:
 
     case RESULT_DECL:
     case VAR_DECL:
@@ -2805,7 +2841,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
       if (!decl_rtl)
        DBXOUT_DECR_NESTING_AND_RETURN (0);
 
       if (!decl_rtl)
        DBXOUT_DECR_NESTING_AND_RETURN (0);
 
-      decl_rtl = eliminate_regs (decl_rtl, 0, NULL_RTX);
+      decl_rtl = eliminate_regs (decl_rtl, VOIDmode, NULL_RTX);
 #ifdef LEAF_REG_REMAP
       if (current_function_uses_only_leaf_regs)
        leaf_renumber_regs_insn (decl_rtl);
 #ifdef LEAF_REG_REMAP
       if (current_function_uses_only_leaf_regs)
        leaf_renumber_regs_insn (decl_rtl);
@@ -2831,7 +2867,7 @@ static int
 dbxout_symbol_location (tree decl, tree type, const char *suffix, rtx home)
 {
   int letter = 0;
 dbxout_symbol_location (tree decl, tree type, const char *suffix, rtx home)
 {
   int letter = 0;
-  STAB_CODE_TYPE code;
+  stab_code_type code;
   rtx addr = 0;
   int number = 0;
   int regno = -1;
   rtx addr = 0;
   int number = 0;
   int regno = -1;
@@ -3011,7 +3047,7 @@ dbxout_symbol_location (tree decl, tree type, const char *suffix, rtx home)
     }
   else if (MEM_P (home)
           && GET_CODE (XEXP (home, 0)) == PLUS
     }
   else if (MEM_P (home)
           && GET_CODE (XEXP (home, 0)) == PLUS
-          && GET_CODE (XEXP (XEXP (home, 0), 1)) == CONST_INT)
+          && CONST_INT_P (XEXP (XEXP (home, 0), 1)))
     {
       code = N_LSYM;
       /* RTL looks like (MEM (PLUS (REG...) (CONST_INT...)))
     {
       code = N_LSYM;
       /* RTL looks like (MEM (PLUS (REG...) (CONST_INT...)))
@@ -3102,7 +3138,7 @@ dbxout_symbol_name (tree decl, const char *suffix, int letter)
 {
   tree name;
 
 {
   tree name;
 
-  if (DECL_CONTEXT (decl) 
+  if (DECL_CONTEXT (decl)
       && (TYPE_P (DECL_CONTEXT (decl))
          || TREE_CODE (DECL_CONTEXT (decl)) == NAMESPACE_DECL))
     /* One slight hitch: if this is a VAR_DECL which is a class member
       && (TYPE_P (DECL_CONTEXT (decl))
          || TREE_CODE (DECL_CONTEXT (decl)) == NAMESPACE_DECL))
     /* One slight hitch: if this is a VAR_DECL which is a class member
@@ -3136,7 +3172,7 @@ dbxout_symbol_name (tree decl, const char *suffix, int letter)
    emits the N_BCOMM and N_ECOMM stabs.  */
 
 static void
    emits the N_BCOMM and N_ECOMM stabs.  */
 
 static void
-dbxout_common_name (tree decl, const char *name, STAB_CODE_TYPE op)
+dbxout_common_name (tree decl, const char *name, stab_code_type op)
 {
   dbxout_begin_complex_stabs ();
   stabstr_S (name);
 {
   dbxout_begin_complex_stabs ();
   stabstr_S (name);
@@ -3154,24 +3190,23 @@ dbxout_common_check (tree decl, int *value)
   rtx home;
   rtx sym_addr;
   const char *name = NULL;
   rtx home;
   rtx sym_addr;
   const char *name = NULL;
-  
-  /* If the decl isn't a VAR_DECL, or if it isn't public or static, or if
+
+  /* If the decl isn't a VAR_DECL, or if it isn't static, or if
      it does not have a value (the offset into the common area), or if it
      is thread local (as opposed to global) then it isn't common, and shouldn't
      be handled as such.
      it does not have a value (the offset into the common area), or if it
      is thread local (as opposed to global) then it isn't common, and shouldn't
      be handled as such.
-     
+
      ??? DECL_THREAD_LOCAL_P check prevents problems with improper .stabs
      for thread-local symbols.  Can be handled via same mechanism as used
      in dwarf2out.c.  */
   if (TREE_CODE (decl) != VAR_DECL
      ??? DECL_THREAD_LOCAL_P check prevents problems with improper .stabs
      for thread-local symbols.  Can be handled via same mechanism as used
      in dwarf2out.c.  */
   if (TREE_CODE (decl) != VAR_DECL
-      || !TREE_PUBLIC(decl)
       || !TREE_STATIC(decl)
       || !DECL_HAS_VALUE_EXPR_P(decl)
       || DECL_THREAD_LOCAL_P (decl)
       || !is_fortran ())
     return NULL;
 
       || !TREE_STATIC(decl)
       || !DECL_HAS_VALUE_EXPR_P(decl)
       || DECL_THREAD_LOCAL_P (decl)
       || !is_fortran ())
     return NULL;
 
-  home = DECL_RTL (decl); 
+  home = DECL_RTL (decl);
   if (home == NULL_RTX || GET_CODE (home) != MEM)
     return NULL;
 
   if (home == NULL_RTX || GET_CODE (home) != MEM)
     return NULL;
 
@@ -3197,7 +3232,7 @@ dbxout_common_check (tree decl, int *value)
       switch (GET_CODE (sym_addr))
         {
         case PLUS:
       switch (GET_CODE (sym_addr))
         {
         case PLUS:
-          if (GET_CODE (XEXP (sym_addr, 0)) == CONST_INT)
+          if (CONST_INT_P (XEXP (sym_addr, 0)))
             {
               name =
                 targetm.strip_name_encoding(XSTR (XEXP (sym_addr, 1), 0));
             {
               name =
                 targetm.strip_name_encoding(XSTR (XEXP (sym_addr, 1), 0));
@@ -3304,14 +3339,15 @@ dbxout_parms (tree parms)
       {
        tree eff_type;
        char letter;
       {
        tree eff_type;
        char letter;
-       STAB_CODE_TYPE code;
+       stab_code_type code;
        int number;
 
        /* Perform any necessary register eliminations on the parameter's rtl,
           so that the debugging output will be accurate.  */
        DECL_INCOMING_RTL (parms)
        int number;
 
        /* Perform any necessary register eliminations on the parameter's rtl,
           so that the debugging output will be accurate.  */
        DECL_INCOMING_RTL (parms)
-         = eliminate_regs (DECL_INCOMING_RTL (parms), 0, NULL_RTX);
-       SET_DECL_RTL (parms, eliminate_regs (DECL_RTL (parms), 0, NULL_RTX));
+         = eliminate_regs (DECL_INCOMING_RTL (parms), VOIDmode, NULL_RTX);
+       SET_DECL_RTL (parms,
+                     eliminate_regs (DECL_RTL (parms), VOIDmode, NULL_RTX));
 #ifdef LEAF_REG_REMAP
        if (current_function_uses_only_leaf_regs)
          {
 #ifdef LEAF_REG_REMAP
        if (current_function_uses_only_leaf_regs)
          {
@@ -3329,7 +3365,7 @@ dbxout_parms (tree parms)
               If that is not true, we produce meaningless results,
               but do not crash.  */
            if (GET_CODE (inrtl) == PLUS
               If that is not true, we produce meaningless results,
               but do not crash.  */
            if (GET_CODE (inrtl) == PLUS
-               && GET_CODE (XEXP (inrtl, 1)) == CONST_INT)
+               && CONST_INT_P (XEXP (inrtl, 1)))
              number = INTVAL (XEXP (inrtl, 1));
            else
              number = 0;
              number = INTVAL (XEXP (inrtl, 1));
            else
              number = 0;
@@ -3372,6 +3408,8 @@ dbxout_parms (tree parms)
               was passed.  */
            if (REGNO (DECL_RTL (parms)) < FIRST_PSEUDO_REGISTER)
              best_rtl = DECL_RTL (parms);
               was passed.  */
            if (REGNO (DECL_RTL (parms)) < FIRST_PSEUDO_REGISTER)
              best_rtl = DECL_RTL (parms);
+           else if (GET_CODE (DECL_INCOMING_RTL (parms)) == PARALLEL)
+             best_rtl = XEXP (XVECEXP (DECL_INCOMING_RTL (parms), 0, 0), 0);
            else
              best_rtl = DECL_INCOMING_RTL (parms);
 
            else
              best_rtl = DECL_INCOMING_RTL (parms);
 
@@ -3393,7 +3431,7 @@ dbxout_parms (tree parms)
               that it was actually passed by invisible reference.  */
 
            code = DBX_REGPARM_STABS_CODE;
               that it was actually passed by invisible reference.  */
 
            code = DBX_REGPARM_STABS_CODE;
+
            /* GDB likes this marked with a special letter.  */
            letter = (use_gnu_debug_info_extensions
                      ? 'a' : DBX_REGPARM_STABS_LETTER);
            /* GDB likes this marked with a special letter.  */
            letter = (use_gnu_debug_info_extensions
                      ? 'a' : DBX_REGPARM_STABS_LETTER);
@@ -3464,7 +3502,7 @@ dbxout_parms (tree parms)
          continue;
 
        dbxout_begin_complex_stabs ();
          continue;
 
        dbxout_begin_complex_stabs ();
-           
+
        if (DECL_NAME (parms))
          {
            stabstr_I (DECL_NAME (parms));
        if (DECL_NAME (parms))
          {
            stabstr_I (DECL_NAME (parms));
@@ -3619,20 +3657,6 @@ dbxout_block (tree block, int depth, tree args)
                  scope_start = buf;
                }
 
                  scope_start = buf;
                }
 
-             if (BLOCK_HANDLER_BLOCK (block))
-               {
-                 /* A catch block.  Must precede N_LBRAC.  */
-                 tree decl = BLOCK_VARS (block);
-                 while (decl)
-                   {
-                     dbxout_begin_complex_stabs ();
-                     stabstr_I (DECL_NAME (decl));
-                     stabstr_S (":C1");
-                     dbxout_finish_complex_stabs (0, N_CATCH, 0,
-                                                  scope_start, 0);
-                     decl = TREE_CHAIN (decl);
-                   }
-               }
              dbx_output_lbrac (scope_start, begin_label);
            }
 
              dbx_output_lbrac (scope_start, begin_label);
            }
 
@@ -3667,9 +3691,6 @@ dbxout_begin_function (tree decl)
 {
   int saved_tree_used1;
 
 {
   int saved_tree_used1;
 
-  if (DECL_IGNORED_P (decl))
-    return;
-
   saved_tree_used1 = TREE_USED (decl);
   TREE_USED (decl) = 1;
   if (DECL_NAME (DECL_RESULT (decl)) != 0)
   saved_tree_used1 = TREE_USED (decl);
   TREE_USED (decl) = 1;
   if (DECL_NAME (DECL_RESULT (decl)) != 0)