This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Remove MIPS_DEBUGGING_INFO support


"Joseph S. Myers" <joseph@codesourcery.com> writes:

> On Mon, 5 Mar 2012, Rainer Orth wrote:
>
>> The only two users of MIPS_DEBUGGING_INFO are on their way out: I've
>> just submitted a patch to remove the OpenBSD/MIPS configuration, and
>> IRIX removal will follow soon.  There seems to be no point in retaining
>> what seems to be primarily workarounds for quirks in SGI dbx, so the
>> following patch removes all other remnants of MIPS_DEBUGGING_INFO.
>
> As a removed target macro it should be poisoned in system.h.

This is the patch I comitted after rebootstrapping on
i386-pc-solaris2.11, once the remaining uses of MIPS_DEBUGGING_INFO in
gcc/config/alpha were gone.

	Rainer


2012-02-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* dwarf2cfi.c (def_cfa_0): Remove MIPS_DEBUGGING_INFO handling.
	(dwarf2out_do_cfi_asm): Likewise.
	* dwarf2out.c (output_call_frame_info): Remove MIPS_DEBUGGING_INFO
	handling.
	(add_data_member_location_attribute): Likewise.
	(gen_array_type_die): Likewise.
	(gen_subprogram_die): Likewise.
	(gen_producer_string): Likewise.
	* sdbout.c (sdbout_begin_prologue): Declare unconditionally.
	Remove MIPS_DEBUGGING_INFO handling.
	(sdb_debug_hooks): Likewise.
	(sdbout_begin_block): Likewise.
	(sdbout_end_block): Likewise.
	(sdbout_begin_prologue): Likewise.
	(sdbout_start_source_file): Likewise.
	(sdbout_end_source_file): Likewise.
	(sdbout_init): Likewise.
	* system.h (MIPS_DEBUGGING_INFO): Poison.

# HG changeset patch
# Parent 4495daa74b1dc1d5edbb14483970ce19ec823529
Remove MIPS_DEBUGGING_INFO support

diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
--- a/gcc/dwarf2cfi.c
+++ b/gcc/dwarf2cfi.c
@@ -1,6 +1,6 @@
 /* Dwarf2 Call Frame Information helper routines.
    Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -724,8 +724,6 @@ def_cfa_0 (dw_cfa_location *old_cfa, dw_
 	cfi->dw_cfi_opc = DW_CFA_def_cfa_offset;
       cfi->dw_cfi_oprnd1.dw_cfi_offset = new_cfa->offset;
     }
-
-#ifndef MIPS_DEBUGGING_INFO  /* SGI dbx thinks this means no offset.  */
   else if (new_cfa->offset == old_cfa->offset
 	   && old_cfa->reg != INVALID_REGNUM
 	   && !new_cfa->indirect
@@ -737,8 +735,6 @@ def_cfa_0 (dw_cfa_location *old_cfa, dw_
       cfi->dw_cfi_opc = DW_CFA_def_cfa_register;
       cfi->dw_cfi_oprnd1.dw_cfi_reg_num = new_cfa->reg;
     }
-#endif
-
   else if (new_cfa->indirect == 0)
     {
       /* Construct a "DW_CFA_def_cfa <register> <offset>" instruction,
@@ -3388,10 +3384,6 @@ dwarf2out_do_cfi_asm (void)
 {
   int enc;
 
-#ifdef MIPS_DEBUGGING_INFO
-  return false;
-#endif
-
   if (saved_do_cfi_asm != 0)
     return saved_do_cfi_asm > 0;
 
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -879,11 +879,6 @@ output_call_frame_info (int for_eh)
 
   if (for_eh && targetm.terminate_dw2_eh_frame_info)
     dw2_asm_output_data (4, 0, "End of Table");
-#ifdef MIPS_DEBUGGING_INFO
-  /* Work around Irix 6 assembler bug whereby labels at the end of a section
-     get a value of 0.  Putting .align 0 after the label fixes it.  */
-  ASM_OUTPUT_ALIGN (asm_out_file, 0);
-#endif
 
   /* Turn off app to make assembly quicker.  */
   if (flag_debug_asm)
@@ -14330,16 +14325,7 @@ add_data_member_location_attribute (dw_d
 	  /* The DWARF2 standard says that we should assume that the structure
 	     address is already on the stack, so we can specify a structure
 	     field address by using DW_OP_plus_uconst.  */
-
-#ifdef MIPS_DEBUGGING_INFO
-	  /* ??? The SGI dwarf reader does not handle the DW_OP_plus_uconst
-	     operator correctly.  It works only if we leave the offset on the
-	     stack.  */
-	  op = DW_OP_constu;
-#else
 	  op = DW_OP_plus_uconst;
-#endif
-
 	  loc_descr = new_loc_descr (op, offset, 0);
 	}
     }
@@ -16368,17 +16354,6 @@ gen_array_type_die (tree type, dw_die_re
       return;
     }
 
-  /* ??? The SGI dwarf reader fails for array of array of enum types
-     (e.g. const enum machine_mode insn_operand_mode[2][10]) unless the inner
-     array type comes before the outer array type.  We thus call gen_type_die
-     before we new_die and must prevent nested array types collapsing for this
-     target.  */
-
-#ifdef MIPS_DEBUGGING_INFO
-  gen_type_die (TREE_TYPE (type), context_die);
-  collapse_nested_arrays = false;
-#endif
-
   array_die = new_die (DW_TAG_array_type, scope_die, type);
   add_name_attribute (array_die, type_tag (type));
   equate_type_number_to_die (type, array_die);
@@ -16404,14 +16379,6 @@ gen_array_type_die (tree type, dw_die_re
   add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_row_major);
 #endif
 
-#ifdef MIPS_DEBUGGING_INFO
-  /* The SGI compilers handle arrays of unknown bound by setting
-     AT_declaration and not emitting any subrange DIEs.  */
-  if (TREE_CODE (type) == ARRAY_TYPE
-      && ! TYPE_DOMAIN (type))
-    add_AT_flag (array_die, DW_AT_declaration, 1);
-  else
-#endif
   if (TREE_CODE (type) == VECTOR_TYPE)
     {
       /* For VECTOR_TYPEs we use an array die with appropriate bounds.  */
@@ -16434,10 +16401,6 @@ gen_array_type_die (tree type, dw_die_re
 	element_type = TREE_TYPE (element_type);
       }
 
-#ifndef MIPS_DEBUGGING_INFO
-  gen_type_die (element_type, context_die);
-#endif
-
   add_type_attribute (array_die, element_type, 0, 0, context_die);
 
   add_gnat_descriptive_type_attribute (array_die, type, context_die);
@@ -17470,11 +17433,6 @@ gen_subprogram_die (tree decl, dw_die_re
 	    }
 	}
 
-#ifdef MIPS_DEBUGGING_INFO
-      /* Add a reference to the FDE for this routine.  */
-      add_AT_fde_ref (subr_die, DW_AT_MIPS_fde, cfun->fde->fde_index);
-#endif
-
       cfa_fb_offset = CFA_FRAME_BASE_OFFSET (decl);
 
       /* We define the "frame base" as the function's CFA.  This is more
@@ -18448,24 +18406,6 @@ gen_producer_string (void)
   sprintf (tail, "%s %s", language_string, version_string);
   tail += plen;
 
-  if (!dwarf_record_gcc_switches)
-    {
-#ifdef MIPS_DEBUGGING_INFO
-      /* The MIPS/SGI compilers place the 'cc' command line options in the
-	 producer string.  The SGI debugger looks for -g, -g1, -g2, or -g3;
-	 if they do not appear in the producer string, the debugger reaches
-	 the conclusion that the object file is stripped and has no debugging
-	 information.  To get the MIPS/SGI debugger to believe that there is
-	 debugging information in the object file, we add a -g to the producer
-	 string.  */
-      if (debug_info_level > DINFO_LEVEL_TERSE)
-	{
-	  memcpy (tail, " -g", 3);
-	  tail += 3;
-	}
-#endif
-    }
-
   FOR_EACH_VEC_ELT (dchar_p, switches, j, p)
     {
       len = strlen (p);
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -1,6 +1,6 @@
 /* Output sdb-format symbol table information from GNU compiler.
    Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
+   2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011, 2012
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -120,9 +120,7 @@ static void sdbout_end_block		(unsigned 
 static void sdbout_source_line		(unsigned int, const char *, int, bool);
 static void sdbout_end_epilogue		(unsigned int, const char *);
 static void sdbout_global_decl		(tree);
-#ifndef MIPS_DEBUGGING_INFO
 static void sdbout_begin_prologue	(unsigned int, const char *);
-#endif
 static void sdbout_end_prologue		(unsigned int, const char *);
 static void sdbout_begin_function	(tree);
 static void sdbout_end_function		(unsigned int);
@@ -275,33 +273,6 @@ do { fprintf (asm_out_file, "\t.tag\t");
   if ((int) line <= sdb_begin_function_line) \
     line = sdb_begin_function_line + 1
 
-/* Perform linker optimization of merging header file definitions together
-   for targets with MIPS_DEBUGGING_INFO defined.  This won't work without a
-   post 960826 version of GAS.  Nothing breaks with earlier versions of GAS,
-   the optimization just won't be done.  The native assembler already has the
-   necessary support.  */
-
-#ifdef MIPS_DEBUGGING_INFO
-
-/* ECOFF linkers have an optimization that does the same kind of thing as
-   N_BINCL/E_INCL in stabs: eliminate duplicate debug information in the
-   executable.  To achieve this, GCC must output a .file for each file
-   name change.  */
-
-/* This is a stack of input files.  */
-
-struct sdb_file
-{
-  struct sdb_file *next;
-  const char *name;
-};
-
-/* This is the top of the stack.  */
-
-static struct sdb_file *current_file;
-
-#endif /* MIPS_DEBUGGING_INFO */
-
 /* The debug hooks structure.  */
 const struct gcc_debug_hooks sdb_debug_hooks =
 {
@@ -316,15 +287,8 @@ const struct gcc_debug_hooks sdb_debug_h
   sdbout_end_block,		         /* end_block */
   debug_true_const_tree,	         /* ignore_block */
   sdbout_source_line,		         /* source_line */
-#ifdef MIPS_DEBUGGING_INFO
-  /* Defer on MIPS systems so that parameter descriptions follow
-     function entry.  */
-  debug_nothing_int_charstar,	         /* begin_prologue */
-  sdbout_end_prologue,		         /* end_prologue */
-#else
   sdbout_begin_prologue,	         /* begin_prologue */
   debug_nothing_int_charstar,	         /* end_prologue */
-#endif
   debug_nothing_int_charstar,	         /* begin_epilogue */
   sdbout_end_epilogue,		         /* end_epilogue */
   sdbout_begin_function,	         /* begin_function */
@@ -1500,12 +1464,8 @@ sdbout_begin_block (unsigned int line, u
   MAKE_LINE_SAFE (line);
 
   /* The SCO compiler does not emit a separate block for the function level
-     scope, so we avoid it here also.  However, mips ECOFF compilers do emit
-     a separate block, so we retain it when MIPS_DEBUGGING_INFO is defined.  */
-#ifndef MIPS_DEBUGGING_INFO
-  if (n != 1)
-#endif
-    PUT_SDB_BLOCK_START (line - sdb_begin_function_line);
+     scope, so we avoid it here also.  */
+  PUT_SDB_BLOCK_START (line - sdb_begin_function_line);
 
   if (n == 1)
     {
@@ -1534,12 +1494,9 @@ sdbout_end_block (unsigned int line, uns
   MAKE_LINE_SAFE (line);
 
   /* The SCO compiler does not emit a separate block for the function level
-     scope, so we avoid it here also.  However, mips ECOFF compilers do emit
-     a separate block, so we retain it when MIPS_DEBUGGING_INFO is defined.  */
-#ifndef MIPS_DEBUGGING_INFO
+     scope, so we avoid it here also.  */
   if (n != 1)
-#endif
-  PUT_SDB_BLOCK_END (line - sdb_begin_function_line);
+    PUT_SDB_BLOCK_END (line - sdb_begin_function_line);
 }
 
 /* Output a line number symbol entry for source file FILENAME and line
@@ -1572,19 +1529,16 @@ sdbout_begin_function (tree decl ATTRIBU
   sdbout_symbol (current_function_decl, 0);
 }
 
-/* Called at beginning of function body (before or after prologue,
-   depending on MIPS_DEBUGGING_INFO).  Record the function's starting
-   line number, so we can output relative line numbers for the other
-   lines.  Describe beginning of outermost block.  Also describe the
-   parameter list.  */
+/* Called at beginning of function body after prologue.  Record the
+   function's starting line number, so we can output relative line numbers
+   for the other lines.  Describe beginning of outermost block.  Also
+   describe the parameter list.  */
 
-#ifndef MIPS_DEBUGGING_INFO
 static void
 sdbout_begin_prologue (unsigned int line, const char *file ATTRIBUTE_UNUSED)
 {
   sdbout_end_prologue (line, file);
 }
-#endif
 
 static void
 sdbout_end_prologue (unsigned int line, const char *file ATTRIBUTE_UNUSED)
@@ -1651,14 +1605,6 @@ static void
 sdbout_start_source_file (unsigned int line ATTRIBUTE_UNUSED,
 			  const char *filename ATTRIBUTE_UNUSED)
 {
-#ifdef MIPS_DEBUGGING_INFO
-  struct sdb_file *n = XNEW (struct sdb_file);
-
-  n->next = current_file;
-  n->name = filename;
-  current_file = n;
-  output_file_directive (asm_out_file, filename);
-#endif
 }
 
 /* Revert to reading a previous source file.  */
@@ -1666,14 +1612,6 @@ sdbout_start_source_file (unsigned int l
 static void
 sdbout_end_source_file (unsigned int line ATTRIBUTE_UNUSED)
 {
-#ifdef MIPS_DEBUGGING_INFO
-  struct sdb_file *next;
-
-  next = current_file->next;
-  free (current_file);
-  current_file = next;
-  output_file_directive (asm_out_file, current_file->name);
-#endif
 }
 
 /* Set up for SDB output at the start of compilation.  */
@@ -1683,12 +1621,6 @@ sdbout_init (const char *input_file_name
 {
   tree t;
 
-#ifdef MIPS_DEBUGGING_INFO
-  current_file = XNEW (struct sdb_file);
-  current_file->next = NULL;
-  current_file->name = input_file_name;
-#endif
-
   deferred_global_decls = VEC_alloc (tree, gc, 12);
 
   /* Emit debug information which was queued by sdbout_symbol before
diff --git a/gcc/system.h b/gcc/system.h
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -878,8 +878,8 @@ extern void fancy_abort (const char *, i
 	MACHINE_TYPE TARGET_HAS_TARGETCM ASM_OUTPUT_BSS			   \
 	SETJMP_VIA_SAVE_AREA FORBIDDEN_INC_DEC_CLASSES			   \
 	PREFERRED_OUTPUT_RELOAD_CLASS SYSTEM_INCLUDE_DIR		   \
-	STANDARD_INCLUDE_DIR STANDARD_INCLUDE_COMPONENT \
-	LINK_ELIMINATE_DUPLICATE_LDIRECTORIES
+	STANDARD_INCLUDE_DIR STANDARD_INCLUDE_COMPONENT			   \
+	LINK_ELIMINATE_DUPLICATE_LDIRECTORIES MIPS_DEBUGGING_INFO
 
 /* Hooks that are no longer used.  */
  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE	\

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]