diff mbox

Remove -feliminate-dwarf2-dups

Message ID alpine.LSU.2.20.1708211614530.14191@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Aug. 21, 2017, 2:16 p.m. UTC
This was agreed upon and now that early LTO debug landed here it is.

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

In case the gcc_unreachable () gets through I'll instead remove the
if as noted in my followup TODO.

Richard.

2017-08-21  Richard Biener  <rguenther@suse.de>

	* common.opt (feliminate-dwarf2-dups): Ignore.
	* doc/invoke.texi (feliminate-dwarf2-dups): Remove documentation.
	* dwarf2out.c (push_new_compile_unit, pop_compile_unit,
	same_die_p_wrap, compute_section_prefix,
	is_symbol_die, assign_symbol_names, break_out_includes): Remove.
	(comdat_symbol_id, comdat_symbol_number): Likewise.
	(cu_hash_table_entry, cu_hash_table_entry_hasher, cu_hash_type):
	Likewise.
	(check_duplicate_cu, record_comdat_symbol_number): Likewise.
	(output_die): Mark unreachable path unreachable.
	(dwarf2out_start_source_file): Do not create DW_TAG_GNU_BINCL.
	(dwarf2out_end_source_file): Do not create DW_TAG_GNU_EINCL.
	(dwarf2out_init): Remove code handling flag_eliminate_dwarf2_dups.
	(dwarf2out_early_finish): Likewise.

	* g++.dg/debug/dwarf2/dwarf2-1.C: Remove -feliminate-dwarf2-dups.
	* g++.dg/debug/dwarf2/dwarf2-2.C: Likewise.
	* g++.dg/debug/dwarf2/pr46123-2.C: Likewise.
	* g++.dg/debug/dwarf2/typedef5.C: Likewise.
	* gcc.dg/debug/dwarf2/dwarf2-3.c: Likewise.
	* gcc.dg/debug/dwarf2/dwarf2-3.h: Likewise.
	* gcc.dg/debug/dwarf2/dups-types.c: Remove.
	* gcc.dg/debug/dwarf2/dups-types.h: Likewise.

Comments

Richard Biener Aug. 22, 2017, 8:47 a.m. UTC | #1
On Mon, 21 Aug 2017, Richard Biener wrote:

> 
> This was agreed upon and now that early LTO debug landed here it is.
> 
> Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
> 
> In case the gcc_unreachable () gets through I'll instead remove the
> if as noted in my followup TODO.

Applied w/o the

@@ -10259,7 +10001,10 @@ output_die (dw_die_ref die)
          on the section beginning, not on the actual DIE.  */
       && (!flag_generate_lto
          || die->die_tag != DW_TAG_compile_unit))
-    output_die_symbol (die);
+    {
+      output_die_symbol (die);
+      gcc_unreachable ();
+    }

   dw2_asm_output_data_uleb128 (die->die_abbrev, "(DIE (%#lx) %s)",
                               (unsigned long)die->die_offset,

hunk, I'll remove it as followup (passed LTO bootstrap and the dwarf
tests with -flto -g w/o ICEing).

Richard.

> Richard.
> 
> 2017-08-21  Richard Biener  <rguenther@suse.de>
> 
> 	* common.opt (feliminate-dwarf2-dups): Ignore.
> 	* doc/invoke.texi (feliminate-dwarf2-dups): Remove documentation.
> 	* dwarf2out.c (push_new_compile_unit, pop_compile_unit,
> 	same_die_p_wrap, compute_section_prefix,
> 	is_symbol_die, assign_symbol_names, break_out_includes): Remove.
> 	(comdat_symbol_id, comdat_symbol_number): Likewise.
> 	(cu_hash_table_entry, cu_hash_table_entry_hasher, cu_hash_type):
> 	Likewise.
> 	(check_duplicate_cu, record_comdat_symbol_number): Likewise.
> 	(output_die): Mark unreachable path unreachable.
> 	(dwarf2out_start_source_file): Do not create DW_TAG_GNU_BINCL.
> 	(dwarf2out_end_source_file): Do not create DW_TAG_GNU_EINCL.
> 	(dwarf2out_init): Remove code handling flag_eliminate_dwarf2_dups.
> 	(dwarf2out_early_finish): Likewise.
> 
> 	* g++.dg/debug/dwarf2/dwarf2-1.C: Remove -feliminate-dwarf2-dups.
> 	* g++.dg/debug/dwarf2/dwarf2-2.C: Likewise.
> 	* g++.dg/debug/dwarf2/pr46123-2.C: Likewise.
> 	* g++.dg/debug/dwarf2/typedef5.C: Likewise.
> 	* gcc.dg/debug/dwarf2/dwarf2-3.c: Likewise.
> 	* gcc.dg/debug/dwarf2/dwarf2-3.h: Likewise.
> 	* gcc.dg/debug/dwarf2/dups-types.c: Remove.
> 	* gcc.dg/debug/dwarf2/dups-types.h: Likewise.
> 
> Index: gcc/common.opt
> ===================================================================
> --- gcc/common.opt	(revision 251222)
> +++ gcc/common.opt	(working copy)
> @@ -1303,8 +1303,8 @@ Common Report Var(flag_early_inlining) I
>  Perform early inlining.
>  
>  feliminate-dwarf2-dups
> -Common Report Var(flag_eliminate_dwarf2_dups)
> -Perform DWARF duplicate elimination.
> +Common Ignore
> +Does nothing.  Preserved for backward compatibility.
>  
>  fipa-sra
>  Common Report Var(flag_ipa_sra) Init(0) Optimization
> Index: gcc/doc/invoke.texi
> ===================================================================
> --- gcc/doc/invoke.texi	(revision 251222)
> +++ gcc/doc/invoke.texi	(working copy)
> @@ -347,7 +347,7 @@ Objective-C and Objective-C++ Dialects}.
>  -gcolumn-info  -gno-column-info @gol
>  -gvms  -gxcoff  -gxcoff+  -gz@r{[}=@var{type}@r{]} @gol
>  -fdebug-prefix-map=@var{old}=@var{new}  -fdebug-types-section @gol
> --feliminate-dwarf2-dups  -fno-eliminate-unused-debug-types @gol
> +-fno-eliminate-unused-debug-types @gol
>  -femit-struct-debug-baseonly  -femit-struct-debug-reduced @gol
>  -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
>  -feliminate-unused-debug-symbols  -femit-class-debug-always @gol
> @@ -6834,8 +6834,8 @@ for maximum benefit.
>  
>  GCC no longer supports DWARF Version 1, which is substantially
>  different than Version 2 and later.  For historical reasons, some
> -other DWARF-related options (including @option{-feliminate-dwarf2-dups} 
> -and @option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
> +other DWARF-related options such as
> +@option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
>  in their names, but apply to all currently-supported versions of DWARF.
>  
>  @item -gstabs
> @@ -7027,12 +7027,6 @@ writing compressed debug sections, the o
>  if the assembler does not support them, @option{-gz} is silently ignored
>  when producing object files.
>  
> -@item -feliminate-dwarf2-dups
> -@opindex feliminate-dwarf2-dups
> -Compress DWARF debugging information by eliminating duplicated
> -information about each symbol.  This option only makes sense when
> -generating DWARF debugging information.
> -
>  @item -femit-struct-debug-baseonly
>  @opindex femit-struct-debug-baseonly
>  Emit debug information for struct-like types
> Index: gcc/dwarf2out.c
> ===================================================================
> --- gcc/dwarf2out.c	(revision 251222)
> +++ gcc/dwarf2out.c	(working copy)
> @@ -3422,8 +3422,6 @@ static void equate_decl_number_to_die (t
>  static struct var_loc_node *add_var_loc_to_decl (tree, rtx, const char *);
>  static void print_spaces (FILE *);
>  static void print_die (dw_die_ref, FILE *);
> -static dw_die_ref push_new_compile_unit (dw_die_ref, dw_die_ref);
> -static dw_die_ref pop_compile_unit (dw_die_ref);
>  static void loc_checksum (dw_loc_descr_ref, struct md5_ctx *);
>  static void attr_checksum (dw_attr_node *, struct md5_ctx *, int *);
>  static void die_checksum (dw_die_ref, struct md5_ctx *, int *);
> @@ -3441,14 +3439,9 @@ static int same_loc_p (dw_loc_descr_ref,
>  static int same_dw_val_p (const dw_val_node *, const dw_val_node *, int *);
>  static int same_attr_p (dw_attr_node *, dw_attr_node *, int *);
>  static int same_die_p (dw_die_ref, dw_die_ref, int *);
> -static int same_die_p_wrap (dw_die_ref, dw_die_ref);
> -static void compute_section_prefix (dw_die_ref);
>  static int is_type_die (dw_die_ref);
>  static int is_comdat_die (dw_die_ref);
> -static int is_symbol_die (dw_die_ref);
>  static inline bool is_template_instantiation (dw_die_ref);
> -static void assign_symbol_names (dw_die_ref);
> -static void break_out_includes (dw_die_ref);
>  static int is_declaration_die (dw_die_ref);
>  static int should_move_die_to_comdat (dw_die_ref);
>  static dw_die_ref clone_as_declaration (dw_die_ref);
> @@ -5545,7 +5538,7 @@ dwarf2out_die_ref_for_decl (tree decl, c
>    while (die->die_parent)
>      die = die->die_parent;
>    /* For the containing CU DIE we compute a die_symbol in
> -     compute_section_prefix.  */
> +     compute_comp_unit_symbol.  */
>    gcc_assert (die->die_tag == DW_TAG_compile_unit
>  	      && die->die_id.die_symbol != NULL);
>    *sym = die->die_id.die_symbol;
> @@ -6468,31 +6461,6 @@ check_die (dw_die_ref die)
>      }
>  }
>  
> -/* Start a new compilation unit DIE for an include file.  OLD_UNIT is the CU
> -   for the enclosing include file, if any.  BINCL_DIE is the DW_TAG_GNU_BINCL
> -   DIE that marks the start of the DIEs for this include file.  */
> -
> -static dw_die_ref
> -push_new_compile_unit (dw_die_ref old_unit, dw_die_ref bincl_die)
> -{
> -  const char *filename = get_AT_string (bincl_die, DW_AT_name);
> -  dw_die_ref new_unit = gen_compile_unit_die (filename);
> -
> -  new_unit->die_sib = old_unit;
> -  return new_unit;
> -}
> -
> -/* Close an include-file CU and reopen the enclosing one.  */
> -
> -static dw_die_ref
> -pop_compile_unit (dw_die_ref old_unit)
> -{
> -  dw_die_ref new_unit = old_unit->die_sib;
> -
> -  old_unit->die_sib = NULL;
> -  return new_unit;
> -}
> -
>  #define CHECKSUM(FOO) md5_process_bytes (&(FOO), sizeof (FOO), ctx)
>  #define CHECKSUM_BLOCK(FOO, SIZE) md5_process_bytes ((FOO), (SIZE), ctx)
>  #define CHECKSUM_STRING(FOO) md5_process_bytes ((FOO), strlen (FOO), ctx)
> @@ -7462,27 +7430,6 @@ same_die_p (dw_die_ref die1, dw_die_ref
>    return 1;
>  }
>  
> -/* Do the dies look the same?  Wrapper around same_die_p.  */
> -
> -static int
> -same_die_p_wrap (dw_die_ref die1, dw_die_ref die2)
> -{
> -  int mark = 0;
> -  int ret = same_die_p (die1, die2, &mark);
> -
> -  unmark_all_dies (die1);
> -  unmark_all_dies (die2);
> -
> -  return ret;
> -}
> -
> -/* The prefix to attach to symbols on DIEs in the current comdat debug
> -   info section.  */
> -static const char *comdat_symbol_id;
> -
> -/* The index of the current symbol within the current comdat CU.  */
> -static unsigned int comdat_symbol_number;
> -
>  /* Calculate the MD5 checksum of the compilation unit DIE UNIT_DIE and its
>     children, and set die_symbol.  */
>  
> @@ -7523,15 +7470,6 @@ compute_comp_unit_symbol (dw_die_ref uni
>    unit_die->die_id.die_symbol = xstrdup (name);
>  }
>  
> -static void
> -compute_section_prefix (dw_die_ref unit_die)
> -{
> -  compute_comp_unit_symbol (unit_die);
> -  unit_die->comdat_type_p = true;
> -  comdat_symbol_id = unit_die->die_id.die_symbol;
> -  comdat_symbol_number = 0;
> -}
> -
>  /* Returns nonzero if DIE represents a type, in the sense of TYPE_P.  */
>  
>  static int
> @@ -7595,18 +7533,6 @@ is_comdat_die (dw_die_ref c)
>    return is_type_die (c);
>  }
>  
> -/* Returns 1 iff C is the sort of DIE that might be referred to from another
> -   compilation unit.  */
> -
> -static int
> -is_symbol_die (dw_die_ref c)
> -{
> -  return (is_type_die (c)
> -	  || is_declaration_die (c)
> -	  || c->die_tag == DW_TAG_namespace
> -	  || c->die_tag == DW_TAG_module);
> -}
> -
>  /* Returns true iff C is a compile-unit DIE.  */
>  
>  static inline bool
> @@ -7683,190 +7609,6 @@ gen_internal_sym (const char *prefix)
>    return xstrdup (buf);
>  }
>  
> -/* Assign symbols to all worthy DIEs under DIE.  */
> -
> -static void
> -assign_symbol_names (dw_die_ref die)
> -{
> -  dw_die_ref c;
> -
> -  if (is_symbol_die (die) && !die->comdat_type_p)
> -    {
> -      if (comdat_symbol_id)
> -	{
> -	  char *p = XALLOCAVEC (char, strlen (comdat_symbol_id) + 64);
> -
> -	  sprintf (p, "%s.%s.%x", DIE_LABEL_PREFIX,
> -		   comdat_symbol_id, comdat_symbol_number++);
> -	  die->die_id.die_symbol = xstrdup (p);
> -	}
> -      else
> -	die->die_id.die_symbol = gen_internal_sym ("LDIE");
> -    }
> -
> -  FOR_EACH_CHILD (die, c, assign_symbol_names (c));
> -}
> -
> -struct cu_hash_table_entry
> -{
> -  dw_die_ref cu;
> -  unsigned min_comdat_num, max_comdat_num;
> -  struct cu_hash_table_entry *next;
> -};
> -
> -/* Helpers to manipulate hash table of CUs.  */
> -
> -struct cu_hash_table_entry_hasher : pointer_hash <cu_hash_table_entry>
> -{
> -  typedef die_struct *compare_type;
> -  static inline hashval_t hash (const cu_hash_table_entry *);
> -  static inline bool equal (const cu_hash_table_entry *, const die_struct *);
> -  static inline void remove (cu_hash_table_entry *);
> -};
> -
> -inline hashval_t
> -cu_hash_table_entry_hasher::hash (const cu_hash_table_entry *entry)
> -{
> -  return htab_hash_string (entry->cu->die_id.die_symbol);
> -}
> -
> -inline bool
> -cu_hash_table_entry_hasher::equal (const cu_hash_table_entry *entry1,
> -				   const die_struct *entry2)
> -{
> -  return !strcmp (entry1->cu->die_id.die_symbol, entry2->die_id.die_symbol);
> -}
> -
> -inline void
> -cu_hash_table_entry_hasher::remove (cu_hash_table_entry *entry)
> -{
> -  struct cu_hash_table_entry *next;
> -
> -  while (entry)
> -    {
> -      next = entry->next;
> -      free (entry);
> -      entry = next;
> -    }
> -}
> -
> -typedef hash_table<cu_hash_table_entry_hasher> cu_hash_type;
> -
> -/* Check whether we have already seen this CU and set up SYM_NUM
> -   accordingly.  */
> -static int
> -check_duplicate_cu (dw_die_ref cu, cu_hash_type *htable, unsigned int *sym_num)
> -{
> -  struct cu_hash_table_entry dummy;
> -  struct cu_hash_table_entry **slot, *entry, *last = &dummy;
> -
> -  dummy.max_comdat_num = 0;
> -
> -  slot = htable->find_slot_with_hash (cu,
> -				      htab_hash_string (cu->die_id.die_symbol),
> -				      INSERT);
> -  entry = *slot;
> -
> -  for (; entry; last = entry, entry = entry->next)
> -    {
> -      if (same_die_p_wrap (cu, entry->cu))
> -	break;
> -    }
> -
> -  if (entry)
> -    {
> -      *sym_num = entry->min_comdat_num;
> -      return 1;
> -    }
> -
> -  entry = XCNEW (struct cu_hash_table_entry);
> -  entry->cu = cu;
> -  entry->min_comdat_num = *sym_num = last->max_comdat_num;
> -  entry->next = *slot;
> -  *slot = entry;
> -
> -  return 0;
> -}
> -
> -/* Record SYM_NUM to record of CU in HTABLE.  */
> -static void
> -record_comdat_symbol_number (dw_die_ref cu, cu_hash_type *htable,
> -			     unsigned int sym_num)
> -{
> -  struct cu_hash_table_entry **slot, *entry;
> -
> -  slot = htable->find_slot_with_hash (cu,
> -				      htab_hash_string (cu->die_id.die_symbol),
> -				      NO_INSERT);
> -  entry = *slot;
> -
> -  entry->max_comdat_num = sym_num;
> -}
> -
> -/* Traverse the DIE (which is always comp_unit_die), and set up
> -   additional compilation units for each of the include files we see
> -   bracketed by BINCL/EINCL.  */
> -
> -static void
> -break_out_includes (dw_die_ref die)
> -{
> -  dw_die_ref c;
> -  dw_die_ref unit = NULL;
> -  limbo_die_node *node, **pnode;
> -
> -  c = die->die_child;
> -  if (c) do {
> -    dw_die_ref prev = c;
> -    c = c->die_sib;
> -    while (c->die_tag == DW_TAG_GNU_BINCL || c->die_tag == DW_TAG_GNU_EINCL
> -	   || (unit && is_comdat_die (c)))
> -      {
> -	dw_die_ref next = c->die_sib;
> -
> -	/* This DIE is for a secondary CU; remove it from the main one.  */
> -	remove_child_with_prev (c, prev);
> -
> -	if (c->die_tag == DW_TAG_GNU_BINCL)
> -	  unit = push_new_compile_unit (unit, c);
> -	else if (c->die_tag == DW_TAG_GNU_EINCL)
> -	  unit = pop_compile_unit (unit);
> -	else
> -	  add_child_die (unit, c);
> -	c = next;
> -	if (c == die->die_child)
> -	  break;
> -      }
> -  } while (c != die->die_child);
> -
> -#if 0
> -  /* We can only use this in debugging, since the frontend doesn't check
> -     to make sure that we leave every include file we enter.  */
> -  gcc_assert (!unit);
> -#endif
> -
> -  assign_symbol_names (die);
> -  cu_hash_type cu_hash_table (10);
> -  for (node = limbo_die_list, pnode = &limbo_die_list;
> -       node;
> -       node = node->next)
> -    {
> -      int is_dupl;
> -
> -      compute_section_prefix (node->die);
> -      is_dupl = check_duplicate_cu (node->die, &cu_hash_table,
> -			&comdat_symbol_number);
> -      assign_symbol_names (node->die);
> -      if (is_dupl)
> -	*pnode = node->next;
> -      else
> -	{
> -	  pnode = &node->next;
> -	  record_comdat_symbol_number (node->die, &cu_hash_table,
> -		comdat_symbol_number);
> -	}
> -    }
> -}
> -
>  /* Return non-zero if this DIE is a declaration.  */
>  
>  static int
> @@ -10259,7 +10001,10 @@ output_die (dw_die_ref die)
>           on the section beginning, not on the actual DIE.  */
>        && (!flag_generate_lto
>  	  || die->die_tag != DW_TAG_compile_unit))
> -    output_die_symbol (die);
> +    {
> +      output_die_symbol (die);
> +      gcc_unreachable ();
> +    }
>  
>    dw2_asm_output_data_uleb128 (die->die_abbrev, "(DIE (%#lx) %s)",
>  			       (unsigned long)die->die_offset,
> @@ -10452,9 +10197,9 @@ output_die (dw_die_ref die)
>  		  else
>  		    size = DWARF_OFFSET_SIZE;
>  		  /* ???  We cannot unconditionally output die_offset if
> -		     non-zero - at least -feliminate-dwarf2-dups will
> -		     create references to those DIEs via symbols.  And we
> -		     do not clear its DIE offset after outputting it
> +		     non-zero - others might create references to those
> +		     DIEs via symbols.
> +		     And we do not clear its DIE offset after outputting it
>  		     (and the label refers to the actual DIEs, not the
>  		     DWARF CU unit header which is when using label + offset
>  		     would be the correct thing to do).
> @@ -26946,15 +26691,6 @@ dwarf2out_source_line (unsigned int line
>  static void
>  dwarf2out_start_source_file (unsigned int lineno, const char *filename)
>  {
> -  if (flag_eliminate_dwarf2_dups)
> -    {
> -      /* Record the beginning of the file for break_out_includes.  */
> -      dw_die_ref bincl_die;
> -
> -      bincl_die = new_die (DW_TAG_GNU_BINCL, comp_unit_die (), NULL);
> -      add_AT_string (bincl_die, DW_AT_name, remap_debug_filename (filename));
> -    }
> -
>    if (debug_info_level >= DINFO_LEVEL_VERBOSE)
>      {
>        macinfo_entry e;
> @@ -26970,10 +26706,6 @@ dwarf2out_start_source_file (unsigned in
>  static void
>  dwarf2out_end_source_file (unsigned int lineno ATTRIBUTE_UNUSED)
>  {
> -  if (flag_eliminate_dwarf2_dups)
> -    /* Record the end of the file for break_out_includes.  */
> -    new_die (DW_TAG_GNU_EINCL, comp_unit_die (), NULL);
> -
>    if (debug_info_level >= DINFO_LEVEL_VERBOSE)
>      {
>        macinfo_entry e;
> @@ -27634,14 +27366,6 @@ init_sections_and_labels (bool early_lto
>  static void
>  dwarf2out_init (const char *filename ATTRIBUTE_UNUSED)
>  {
> -  /* This option is currently broken, see (PR53118 and PR46102).  */
> -  if (flag_eliminate_dwarf2_dups
> -      && strstr (lang_hooks.name, "C++"))
> -    {
> -      warning (0, "-feliminate-dwarf2-dups is broken for C++, ignoring");
> -      flag_eliminate_dwarf2_dups = 0;
> -    }
> -
>    /* Allocate the file_table.  */
>    file_table = hash_table<dwarf_file_hasher>::create_ggc (50);
>  
> @@ -30790,21 +30514,6 @@ dwarf2out_early_finish (const char *file
>        prune_unused_types ();
>      }
>  
> -  /* Generate separate CUs for each of the include files we've seen.
> -     They will go into limbo_die_list and from there to cu_die_list.  */
> -  if (flag_eliminate_dwarf2_dups)
> -    {
> -      gcc_assert (limbo_die_list == NULL);
> -      break_out_includes (comp_unit_die ());
> -      limbo_die_node *cu;
> -      while ((cu = limbo_die_list))
> -	{
> -	  limbo_die_list = cu->next;
> -	  cu->next = cu_die_list;
> -	  cu_die_list = cu;
> -	}
> -    }
> -
>    /* Traverse the DIE's and note DIEs with DW_OP_GNU_variable_value still
>       with dw_val_class_decl_ref operand.  */
>    note_variable_value (comp_unit_die ());
> Index: gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-1.C
> ===================================================================
> --- gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-1.C	(revision 251222)
> +++ gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-1.C	(working copy)
> @@ -1,11 +1,10 @@
> -/* { dg-bogus "-feliminate-dwarf2-dups is broken for C\\+\\+, ignoring" "broken -feliminate-dwarf2-dups" { xfail *-*-* } } */
>  // Copyright (C) 2006 Free Software Foundation, Inc.
>  // Contributed by Nathan Sidwell 6 Jan 2006 <nathan@codesourcery.com>
>  
>  // PR 24824
>  // Origin:   	 wanderer@rsu.ru
>  
> -// { dg-options "-gdwarf -feliminate-dwarf2-dups" }
> +// { dg-options "-gdwarf" }
>  
>  namespace N
>  {
> Index: gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-2.C
> ===================================================================
> --- gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-2.C	(revision 251222)
> +++ gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-2.C	(working copy)
> @@ -1,7 +1,6 @@
> -/* { dg-bogus "-feliminate-dwarf2-dups is broken for C\\+\\+, ignoring" "broken -feliminate-dwarf2-dups" { xfail *-*-* } } */
>  // PR debug/27057
>  // { dg-do compile }
> -// { dg-options "-gdwarf -feliminate-dwarf2-dups" }
> +// { dg-options "-gdwarf" }
>  
>  namespace N
>  {
> Index: gcc/testsuite/g++.dg/debug/dwarf2/pr46123-2.C
> ===================================================================
> --- gcc/testsuite/g++.dg/debug/dwarf2/pr46123-2.C	(revision 251222)
> +++ gcc/testsuite/g++.dg/debug/dwarf2/pr46123-2.C	(working copy)
> @@ -1,7 +1,6 @@
> -/* { dg-bogus "-feliminate-dwarf2-dups is broken for C\\+\\+, ignoring" "broken -feliminate-dwarf2-dups" { xfail *-*-* } } */
>  // PR debug/46123
>  // { dg-do compile }
> -// { dg-options "-g -feliminate-dwarf2-dups" }
> +// { dg-options "-g" }
>  
>  struct foo
>  {
> Index: gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C
> ===================================================================
> --- gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C	(revision 251222)
> +++ gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C	(working copy)
> @@ -1,6 +1,5 @@
> -/* { dg-bogus "-feliminate-dwarf2-dups is broken for C\\+\\+, ignoring" "broken -feliminate-dwarf2-dups" { xfail *-*-* } } */
>  // Origin: PR debug/46101
> -// { dg-options "-gdwarf-2 -feliminate-dwarf2-dups" }
> +// { dg-options "-gdwarf-2" }
>  // { dg-do compile }
>  
>  typedef struct
> Index: gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.c	(revision 251222)
> +++ gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.c	(nonexistent)
> @@ -1,8 +0,0 @@
> -/* Test that these two options can work together.  */
> -/* { dg-options "-gdwarf-4 -dA -feliminate-dwarf2-dups -fdebug-types-section" } */
> -/* { dg-final { scan-assembler "DW.dups_types\.h\[^)\]*. DW_TAG_typedef" } } */
> -/* { dg-final { scan-assembler "DW_TAG_type_unit" } } */
> -
> -#include "dups-types.h"
> -
> -A2 a;
> Index: gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.h
> ===================================================================
> --- gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.h	(revision 251222)
> +++ gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.h	(nonexistent)
> @@ -1,10 +0,0 @@
> -struct A
> -{
> -  int i;
> -  int j;
> -};
> -
> -typedef struct A A2;
> -extern A2 a;
> -
> -A2 f(A2);
> Index: gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.c	(revision 251222)
> +++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.c	(working copy)
> @@ -1,7 +1,6 @@
> -/* Test -feliminate-dwarf2-dups */
>  /* Contributed by Devang Patel <dpatel@apple.com> */
>  /* { dg-do compile } */
> -/* { dg-options "-gdwarf -feliminate-dwarf2-dups" } */
> +/* { dg-options "-gdwarf" } */
>  
>  #include "dwarf2-3.h"
>  
> Index: gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.h
> ===================================================================
> --- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.h	(revision 251222)
> +++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.h	(working copy)
> @@ -1,4 +1,3 @@
> -/* Test -feliminate-dwarf2-dups */
>  /* Contributed by Devang Patel <dpatel@apple.com> */
>  
>  struct point
>
diff mbox

Patch

Index: gcc/common.opt
===================================================================
--- gcc/common.opt	(revision 251222)
+++ gcc/common.opt	(working copy)
@@ -1303,8 +1303,8 @@  Common Report Var(flag_early_inlining) I
 Perform early inlining.
 
 feliminate-dwarf2-dups
-Common Report Var(flag_eliminate_dwarf2_dups)
-Perform DWARF duplicate elimination.
+Common Ignore
+Does nothing.  Preserved for backward compatibility.
 
 fipa-sra
 Common Report Var(flag_ipa_sra) Init(0) Optimization
Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(revision 251222)
+++ gcc/doc/invoke.texi	(working copy)
@@ -347,7 +347,7 @@  Objective-C and Objective-C++ Dialects}.
 -gcolumn-info  -gno-column-info @gol
 -gvms  -gxcoff  -gxcoff+  -gz@r{[}=@var{type}@r{]} @gol
 -fdebug-prefix-map=@var{old}=@var{new}  -fdebug-types-section @gol
--feliminate-dwarf2-dups  -fno-eliminate-unused-debug-types @gol
+-fno-eliminate-unused-debug-types @gol
 -femit-struct-debug-baseonly  -femit-struct-debug-reduced @gol
 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
 -feliminate-unused-debug-symbols  -femit-class-debug-always @gol
@@ -6834,8 +6834,8 @@  for maximum benefit.
 
 GCC no longer supports DWARF Version 1, which is substantially
 different than Version 2 and later.  For historical reasons, some
-other DWARF-related options (including @option{-feliminate-dwarf2-dups} 
-and @option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
+other DWARF-related options such as
+@option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
 in their names, but apply to all currently-supported versions of DWARF.
 
 @item -gstabs
@@ -7027,12 +7027,6 @@  writing compressed debug sections, the o
 if the assembler does not support them, @option{-gz} is silently ignored
 when producing object files.
 
-@item -feliminate-dwarf2-dups
-@opindex feliminate-dwarf2-dups
-Compress DWARF debugging information by eliminating duplicated
-information about each symbol.  This option only makes sense when
-generating DWARF debugging information.
-
 @item -femit-struct-debug-baseonly
 @opindex femit-struct-debug-baseonly
 Emit debug information for struct-like types
Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c	(revision 251222)
+++ gcc/dwarf2out.c	(working copy)
@@ -3422,8 +3422,6 @@  static void equate_decl_number_to_die (t
 static struct var_loc_node *add_var_loc_to_decl (tree, rtx, const char *);
 static void print_spaces (FILE *);
 static void print_die (dw_die_ref, FILE *);
-static dw_die_ref push_new_compile_unit (dw_die_ref, dw_die_ref);
-static dw_die_ref pop_compile_unit (dw_die_ref);
 static void loc_checksum (dw_loc_descr_ref, struct md5_ctx *);
 static void attr_checksum (dw_attr_node *, struct md5_ctx *, int *);
 static void die_checksum (dw_die_ref, struct md5_ctx *, int *);
@@ -3441,14 +3439,9 @@  static int same_loc_p (dw_loc_descr_ref,
 static int same_dw_val_p (const dw_val_node *, const dw_val_node *, int *);
 static int same_attr_p (dw_attr_node *, dw_attr_node *, int *);
 static int same_die_p (dw_die_ref, dw_die_ref, int *);
-static int same_die_p_wrap (dw_die_ref, dw_die_ref);
-static void compute_section_prefix (dw_die_ref);
 static int is_type_die (dw_die_ref);
 static int is_comdat_die (dw_die_ref);
-static int is_symbol_die (dw_die_ref);
 static inline bool is_template_instantiation (dw_die_ref);
-static void assign_symbol_names (dw_die_ref);
-static void break_out_includes (dw_die_ref);
 static int is_declaration_die (dw_die_ref);
 static int should_move_die_to_comdat (dw_die_ref);
 static dw_die_ref clone_as_declaration (dw_die_ref);
@@ -5545,7 +5538,7 @@  dwarf2out_die_ref_for_decl (tree decl, c
   while (die->die_parent)
     die = die->die_parent;
   /* For the containing CU DIE we compute a die_symbol in
-     compute_section_prefix.  */
+     compute_comp_unit_symbol.  */
   gcc_assert (die->die_tag == DW_TAG_compile_unit
 	      && die->die_id.die_symbol != NULL);
   *sym = die->die_id.die_symbol;
@@ -6468,31 +6461,6 @@  check_die (dw_die_ref die)
     }
 }
 
-/* Start a new compilation unit DIE for an include file.  OLD_UNIT is the CU
-   for the enclosing include file, if any.  BINCL_DIE is the DW_TAG_GNU_BINCL
-   DIE that marks the start of the DIEs for this include file.  */
-
-static dw_die_ref
-push_new_compile_unit (dw_die_ref old_unit, dw_die_ref bincl_die)
-{
-  const char *filename = get_AT_string (bincl_die, DW_AT_name);
-  dw_die_ref new_unit = gen_compile_unit_die (filename);
-
-  new_unit->die_sib = old_unit;
-  return new_unit;
-}
-
-/* Close an include-file CU and reopen the enclosing one.  */
-
-static dw_die_ref
-pop_compile_unit (dw_die_ref old_unit)
-{
-  dw_die_ref new_unit = old_unit->die_sib;
-
-  old_unit->die_sib = NULL;
-  return new_unit;
-}
-
 #define CHECKSUM(FOO) md5_process_bytes (&(FOO), sizeof (FOO), ctx)
 #define CHECKSUM_BLOCK(FOO, SIZE) md5_process_bytes ((FOO), (SIZE), ctx)
 #define CHECKSUM_STRING(FOO) md5_process_bytes ((FOO), strlen (FOO), ctx)
@@ -7462,27 +7430,6 @@  same_die_p (dw_die_ref die1, dw_die_ref
   return 1;
 }
 
-/* Do the dies look the same?  Wrapper around same_die_p.  */
-
-static int
-same_die_p_wrap (dw_die_ref die1, dw_die_ref die2)
-{
-  int mark = 0;
-  int ret = same_die_p (die1, die2, &mark);
-
-  unmark_all_dies (die1);
-  unmark_all_dies (die2);
-
-  return ret;
-}
-
-/* The prefix to attach to symbols on DIEs in the current comdat debug
-   info section.  */
-static const char *comdat_symbol_id;
-
-/* The index of the current symbol within the current comdat CU.  */
-static unsigned int comdat_symbol_number;
-
 /* Calculate the MD5 checksum of the compilation unit DIE UNIT_DIE and its
    children, and set die_symbol.  */
 
@@ -7523,15 +7470,6 @@  compute_comp_unit_symbol (dw_die_ref uni
   unit_die->die_id.die_symbol = xstrdup (name);
 }
 
-static void
-compute_section_prefix (dw_die_ref unit_die)
-{
-  compute_comp_unit_symbol (unit_die);
-  unit_die->comdat_type_p = true;
-  comdat_symbol_id = unit_die->die_id.die_symbol;
-  comdat_symbol_number = 0;
-}
-
 /* Returns nonzero if DIE represents a type, in the sense of TYPE_P.  */
 
 static int
@@ -7595,18 +7533,6 @@  is_comdat_die (dw_die_ref c)
   return is_type_die (c);
 }
 
-/* Returns 1 iff C is the sort of DIE that might be referred to from another
-   compilation unit.  */
-
-static int
-is_symbol_die (dw_die_ref c)
-{
-  return (is_type_die (c)
-	  || is_declaration_die (c)
-	  || c->die_tag == DW_TAG_namespace
-	  || c->die_tag == DW_TAG_module);
-}
-
 /* Returns true iff C is a compile-unit DIE.  */
 
 static inline bool
@@ -7683,190 +7609,6 @@  gen_internal_sym (const char *prefix)
   return xstrdup (buf);
 }
 
-/* Assign symbols to all worthy DIEs under DIE.  */
-
-static void
-assign_symbol_names (dw_die_ref die)
-{
-  dw_die_ref c;
-
-  if (is_symbol_die (die) && !die->comdat_type_p)
-    {
-      if (comdat_symbol_id)
-	{
-	  char *p = XALLOCAVEC (char, strlen (comdat_symbol_id) + 64);
-
-	  sprintf (p, "%s.%s.%x", DIE_LABEL_PREFIX,
-		   comdat_symbol_id, comdat_symbol_number++);
-	  die->die_id.die_symbol = xstrdup (p);
-	}
-      else
-	die->die_id.die_symbol = gen_internal_sym ("LDIE");
-    }
-
-  FOR_EACH_CHILD (die, c, assign_symbol_names (c));
-}
-
-struct cu_hash_table_entry
-{
-  dw_die_ref cu;
-  unsigned min_comdat_num, max_comdat_num;
-  struct cu_hash_table_entry *next;
-};
-
-/* Helpers to manipulate hash table of CUs.  */
-
-struct cu_hash_table_entry_hasher : pointer_hash <cu_hash_table_entry>
-{
-  typedef die_struct *compare_type;
-  static inline hashval_t hash (const cu_hash_table_entry *);
-  static inline bool equal (const cu_hash_table_entry *, const die_struct *);
-  static inline void remove (cu_hash_table_entry *);
-};
-
-inline hashval_t
-cu_hash_table_entry_hasher::hash (const cu_hash_table_entry *entry)
-{
-  return htab_hash_string (entry->cu->die_id.die_symbol);
-}
-
-inline bool
-cu_hash_table_entry_hasher::equal (const cu_hash_table_entry *entry1,
-				   const die_struct *entry2)
-{
-  return !strcmp (entry1->cu->die_id.die_symbol, entry2->die_id.die_symbol);
-}
-
-inline void
-cu_hash_table_entry_hasher::remove (cu_hash_table_entry *entry)
-{
-  struct cu_hash_table_entry *next;
-
-  while (entry)
-    {
-      next = entry->next;
-      free (entry);
-      entry = next;
-    }
-}
-
-typedef hash_table<cu_hash_table_entry_hasher> cu_hash_type;
-
-/* Check whether we have already seen this CU and set up SYM_NUM
-   accordingly.  */
-static int
-check_duplicate_cu (dw_die_ref cu, cu_hash_type *htable, unsigned int *sym_num)
-{
-  struct cu_hash_table_entry dummy;
-  struct cu_hash_table_entry **slot, *entry, *last = &dummy;
-
-  dummy.max_comdat_num = 0;
-
-  slot = htable->find_slot_with_hash (cu,
-				      htab_hash_string (cu->die_id.die_symbol),
-				      INSERT);
-  entry = *slot;
-
-  for (; entry; last = entry, entry = entry->next)
-    {
-      if (same_die_p_wrap (cu, entry->cu))
-	break;
-    }
-
-  if (entry)
-    {
-      *sym_num = entry->min_comdat_num;
-      return 1;
-    }
-
-  entry = XCNEW (struct cu_hash_table_entry);
-  entry->cu = cu;
-  entry->min_comdat_num = *sym_num = last->max_comdat_num;
-  entry->next = *slot;
-  *slot = entry;
-
-  return 0;
-}
-
-/* Record SYM_NUM to record of CU in HTABLE.  */
-static void
-record_comdat_symbol_number (dw_die_ref cu, cu_hash_type *htable,
-			     unsigned int sym_num)
-{
-  struct cu_hash_table_entry **slot, *entry;
-
-  slot = htable->find_slot_with_hash (cu,
-				      htab_hash_string (cu->die_id.die_symbol),
-				      NO_INSERT);
-  entry = *slot;
-
-  entry->max_comdat_num = sym_num;
-}
-
-/* Traverse the DIE (which is always comp_unit_die), and set up
-   additional compilation units for each of the include files we see
-   bracketed by BINCL/EINCL.  */
-
-static void
-break_out_includes (dw_die_ref die)
-{
-  dw_die_ref c;
-  dw_die_ref unit = NULL;
-  limbo_die_node *node, **pnode;
-
-  c = die->die_child;
-  if (c) do {
-    dw_die_ref prev = c;
-    c = c->die_sib;
-    while (c->die_tag == DW_TAG_GNU_BINCL || c->die_tag == DW_TAG_GNU_EINCL
-	   || (unit && is_comdat_die (c)))
-      {
-	dw_die_ref next = c->die_sib;
-
-	/* This DIE is for a secondary CU; remove it from the main one.  */
-	remove_child_with_prev (c, prev);
-
-	if (c->die_tag == DW_TAG_GNU_BINCL)
-	  unit = push_new_compile_unit (unit, c);
-	else if (c->die_tag == DW_TAG_GNU_EINCL)
-	  unit = pop_compile_unit (unit);
-	else
-	  add_child_die (unit, c);
-	c = next;
-	if (c == die->die_child)
-	  break;
-      }
-  } while (c != die->die_child);
-
-#if 0
-  /* We can only use this in debugging, since the frontend doesn't check
-     to make sure that we leave every include file we enter.  */
-  gcc_assert (!unit);
-#endif
-
-  assign_symbol_names (die);
-  cu_hash_type cu_hash_table (10);
-  for (node = limbo_die_list, pnode = &limbo_die_list;
-       node;
-       node = node->next)
-    {
-      int is_dupl;
-
-      compute_section_prefix (node->die);
-      is_dupl = check_duplicate_cu (node->die, &cu_hash_table,
-			&comdat_symbol_number);
-      assign_symbol_names (node->die);
-      if (is_dupl)
-	*pnode = node->next;
-      else
-	{
-	  pnode = &node->next;
-	  record_comdat_symbol_number (node->die, &cu_hash_table,
-		comdat_symbol_number);
-	}
-    }
-}
-
 /* Return non-zero if this DIE is a declaration.  */
 
 static int
@@ -10259,7 +10001,10 @@  output_die (dw_die_ref die)
          on the section beginning, not on the actual DIE.  */
       && (!flag_generate_lto
 	  || die->die_tag != DW_TAG_compile_unit))
-    output_die_symbol (die);
+    {
+      output_die_symbol (die);
+      gcc_unreachable ();
+    }
 
   dw2_asm_output_data_uleb128 (die->die_abbrev, "(DIE (%#lx) %s)",
 			       (unsigned long)die->die_offset,
@@ -10452,9 +10197,9 @@  output_die (dw_die_ref die)
 		  else
 		    size = DWARF_OFFSET_SIZE;
 		  /* ???  We cannot unconditionally output die_offset if
-		     non-zero - at least -feliminate-dwarf2-dups will
-		     create references to those DIEs via symbols.  And we
-		     do not clear its DIE offset after outputting it
+		     non-zero - others might create references to those
+		     DIEs via symbols.
+		     And we do not clear its DIE offset after outputting it
 		     (and the label refers to the actual DIEs, not the
 		     DWARF CU unit header which is when using label + offset
 		     would be the correct thing to do).
@@ -26946,15 +26691,6 @@  dwarf2out_source_line (unsigned int line
 static void
 dwarf2out_start_source_file (unsigned int lineno, const char *filename)
 {
-  if (flag_eliminate_dwarf2_dups)
-    {
-      /* Record the beginning of the file for break_out_includes.  */
-      dw_die_ref bincl_die;
-
-      bincl_die = new_die (DW_TAG_GNU_BINCL, comp_unit_die (), NULL);
-      add_AT_string (bincl_die, DW_AT_name, remap_debug_filename (filename));
-    }
-
   if (debug_info_level >= DINFO_LEVEL_VERBOSE)
     {
       macinfo_entry e;
@@ -26970,10 +26706,6 @@  dwarf2out_start_source_file (unsigned in
 static void
 dwarf2out_end_source_file (unsigned int lineno ATTRIBUTE_UNUSED)
 {
-  if (flag_eliminate_dwarf2_dups)
-    /* Record the end of the file for break_out_includes.  */
-    new_die (DW_TAG_GNU_EINCL, comp_unit_die (), NULL);
-
   if (debug_info_level >= DINFO_LEVEL_VERBOSE)
     {
       macinfo_entry e;
@@ -27634,14 +27366,6 @@  init_sections_and_labels (bool early_lto
 static void
 dwarf2out_init (const char *filename ATTRIBUTE_UNUSED)
 {
-  /* This option is currently broken, see (PR53118 and PR46102).  */
-  if (flag_eliminate_dwarf2_dups
-      && strstr (lang_hooks.name, "C++"))
-    {
-      warning (0, "-feliminate-dwarf2-dups is broken for C++, ignoring");
-      flag_eliminate_dwarf2_dups = 0;
-    }
-
   /* Allocate the file_table.  */
   file_table = hash_table<dwarf_file_hasher>::create_ggc (50);
 
@@ -30790,21 +30514,6 @@  dwarf2out_early_finish (const char *file
       prune_unused_types ();
     }
 
-  /* Generate separate CUs for each of the include files we've seen.
-     They will go into limbo_die_list and from there to cu_die_list.  */
-  if (flag_eliminate_dwarf2_dups)
-    {
-      gcc_assert (limbo_die_list == NULL);
-      break_out_includes (comp_unit_die ());
-      limbo_die_node *cu;
-      while ((cu = limbo_die_list))
-	{
-	  limbo_die_list = cu->next;
-	  cu->next = cu_die_list;
-	  cu_die_list = cu;
-	}
-    }
-
   /* Traverse the DIE's and note DIEs with DW_OP_GNU_variable_value still
      with dw_val_class_decl_ref operand.  */
   note_variable_value (comp_unit_die ());
Index: gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-1.C
===================================================================
--- gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-1.C	(revision 251222)
+++ gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-1.C	(working copy)
@@ -1,11 +1,10 @@ 
-/* { dg-bogus "-feliminate-dwarf2-dups is broken for C\\+\\+, ignoring" "broken -feliminate-dwarf2-dups" { xfail *-*-* } } */
 // Copyright (C) 2006 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 6 Jan 2006 <nathan@codesourcery.com>
 
 // PR 24824
 // Origin:   	 wanderer@rsu.ru
 
-// { dg-options "-gdwarf -feliminate-dwarf2-dups" }
+// { dg-options "-gdwarf" }
 
 namespace N
 {
Index: gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-2.C
===================================================================
--- gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-2.C	(revision 251222)
+++ gcc/testsuite/g++.dg/debug/dwarf2/dwarf2-2.C	(working copy)
@@ -1,7 +1,6 @@ 
-/* { dg-bogus "-feliminate-dwarf2-dups is broken for C\\+\\+, ignoring" "broken -feliminate-dwarf2-dups" { xfail *-*-* } } */
 // PR debug/27057
 // { dg-do compile }
-// { dg-options "-gdwarf -feliminate-dwarf2-dups" }
+// { dg-options "-gdwarf" }
 
 namespace N
 {
Index: gcc/testsuite/g++.dg/debug/dwarf2/pr46123-2.C
===================================================================
--- gcc/testsuite/g++.dg/debug/dwarf2/pr46123-2.C	(revision 251222)
+++ gcc/testsuite/g++.dg/debug/dwarf2/pr46123-2.C	(working copy)
@@ -1,7 +1,6 @@ 
-/* { dg-bogus "-feliminate-dwarf2-dups is broken for C\\+\\+, ignoring" "broken -feliminate-dwarf2-dups" { xfail *-*-* } } */
 // PR debug/46123
 // { dg-do compile }
-// { dg-options "-g -feliminate-dwarf2-dups" }
+// { dg-options "-g" }
 
 struct foo
 {
Index: gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C
===================================================================
--- gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C	(revision 251222)
+++ gcc/testsuite/g++.dg/debug/dwarf2/typedef5.C	(working copy)
@@ -1,6 +1,5 @@ 
-/* { dg-bogus "-feliminate-dwarf2-dups is broken for C\\+\\+, ignoring" "broken -feliminate-dwarf2-dups" { xfail *-*-* } } */
 // Origin: PR debug/46101
-// { dg-options "-gdwarf-2 -feliminate-dwarf2-dups" }
+// { dg-options "-gdwarf-2" }
 // { dg-do compile }
 
 typedef struct
Index: gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.c
===================================================================
--- gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.c	(revision 251222)
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.c	(nonexistent)
@@ -1,8 +0,0 @@ 
-/* Test that these two options can work together.  */
-/* { dg-options "-gdwarf-4 -dA -feliminate-dwarf2-dups -fdebug-types-section" } */
-/* { dg-final { scan-assembler "DW.dups_types\.h\[^)\]*. DW_TAG_typedef" } } */
-/* { dg-final { scan-assembler "DW_TAG_type_unit" } } */
-
-#include "dups-types.h"
-
-A2 a;
Index: gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.h
===================================================================
--- gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.h	(revision 251222)
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dups-types.h	(nonexistent)
@@ -1,10 +0,0 @@ 
-struct A
-{
-  int i;
-  int j;
-};
-
-typedef struct A A2;
-extern A2 a;
-
-A2 f(A2);
Index: gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.c
===================================================================
--- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.c	(revision 251222)
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.c	(working copy)
@@ -1,7 +1,6 @@ 
-/* Test -feliminate-dwarf2-dups */
 /* Contributed by Devang Patel <dpatel@apple.com> */
 /* { dg-do compile } */
-/* { dg-options "-gdwarf -feliminate-dwarf2-dups" } */
+/* { dg-options "-gdwarf" } */
 
 #include "dwarf2-3.h"
 
Index: gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.h
===================================================================
--- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.h	(revision 251222)
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2-3.h	(working copy)
@@ -1,4 +1,3 @@ 
-/* Test -feliminate-dwarf2-dups */
 /* Contributed by Devang Patel <dpatel@apple.com> */
 
 struct point