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]

[PATCH] Remove -fenable-icf-debug support


Hi!

As Cary said there are no consumers of the .debug_dcall/.debug_vcall
sections yet and DW_TAG_GNU_call_site info should contain a superset
of that information, this patch removes -fenable-icf-debug support,
if you think it is desirable to remove it.
Bootstrapped/regtested on x86_64-linux and i686-linux.

2011-03-15  Jakub Jelinek  <jakub@redhat.com>

	* emit-rtl.c (try_split): Don't call copy_call_info debug hook.
	* calls.c: Remove debug.h include.
	(emit_call_1): Don't call virtual_call_token debug hook.
	* dwarf2out.c (debug_dcall_section, debug_vcall_section,
	dcall_entry, vcall_entry, dcall_table, vcall_table, vcall_insn,
	vcall_insn_table, DEBUG_DCALL_SECTION, DEBUG_VCALL_SECTION,
	size_of_dcall_table, output_dcall_table, size_of_vcall_table,
	output_vcall_table, dwarf2out_direct_call, vcall_insn_table_hash,
	vcall_insn_table_eq, store_vcall_insn, lookup_vcall_insn,
	dwarf2out_virtual_call_token, dwarf2out_copy_call_info,
	dwarf2out_virtual_call): Remove.
	(dwarf2_debug_hooks): Remove direct_call, virtual_call_token,
	copy_call_info and virtual_call hooks.
	(dwarf2out_init): Don't initialize vcall_insn_table,
	debug_dcall_section and debug_vcall_section.
	(prune_unused_types): Don't mark nodes from dcall_table.
	(dwarf2out_finish): Don't output dcall or vcall tables.
	* final.c (final_scan_insn): Don't call direct_call or
	virtual_call debug hooks.
	* debug.h (struct gcc_debug_hooks): Remove direct_call,
	virtual_call_token, copy_call_info and virtual_call hooks.
	(debug_nothing_uid): Remove prototype.
	* sdbout.c (sdb_debug_hooks): Remove direct_call, virtual_call_token,
	copy_call_info and virtual_call hooks.
	* vmsdbgout.c (vmsdbg_debug_hooks): Likewise.
	* dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Likewise.
	* debug.c (do_nothing_debug_hooks): Likewise.
	(debug_nothing_uid): Remove.
	* doc/invoke.texi (-fenable-icf-debug): Remove.
	* common.opt (-fenable-icf-debug): Likewise.

	* g++.dg/debug/dwarf2/icf.C: Adjust for -fenable-icf-debug removal.

--- gcc/emit-rtl.c.jj	2011-01-26 14:07:50.000000000 +0100
+++ gcc/emit-rtl.c	2011-03-15 09:03:55.884620786 +0100
@@ -3477,10 +3477,6 @@ try_split (rtx pat, rtx trial, int last)
 	      p = &XEXP (*p, 1);
 	    *p = CALL_INSN_FUNCTION_USAGE (trial);
 	    SIBLING_CALL_P (insn) = SIBLING_CALL_P (trial);
-
-	    /* Update the debug information for the CALL_INSN.  */
-	    if (flag_enable_icf_debug)
-	      (*debug_hooks->copy_call_info) (trial, insn);
 	  }
     }
 
--- gcc/calls.c.jj	2011-03-14 21:49:08.000000000 +0100
+++ gcc/calls.c	2011-03-15 09:03:01.285671437 +0100
@@ -39,7 +39,6 @@ along with GCC; see the file COPYING3.  
 #include "sbitmap.h"
 #include "langhooks.h"
 #include "target.h"
-#include "debug.h"
 #include "cgraph.h"
 #include "except.h"
 #include "dbgcnt.h"
@@ -407,11 +406,6 @@ emit_call_1 (rtx funexp, tree fntree ATT
 
   SIBLING_CALL_P (call_insn) = ((ecf_flags & ECF_SIBCALL) != 0);
 
-  /* Record debug information for virtual calls.  */
-  if (flag_enable_icf_debug && fndecl == NULL)
-    (*debug_hooks->virtual_call_token) (CALL_EXPR_FN (fntree),
-                                        INSN_UID (call_insn));
-
   /* Restore this now, so that we do defer pops for this call's args
      if the context of the call as a whole permits.  */
   inhibit_defer_pop = old_inhibit_defer_pop;
--- gcc/dwarf2out.c.jj	2011-03-14 21:55:15.000000000 +0100
+++ gcc/dwarf2out.c	2011-03-15 09:33:43.256799916 +0100
@@ -228,8 +228,6 @@ static GTY(()) section *debug_line_secti
 static GTY(()) section *debug_loc_section;
 static GTY(()) section *debug_pubnames_section;
 static GTY(()) section *debug_pubtypes_section;
-static GTY(()) section *debug_dcall_section;
-static GTY(()) section *debug_vcall_section;
 static GTY(()) section *debug_str_section;
 static GTY(()) section *debug_ranges_section;
 static GTY(()) section *debug_frame_section;
@@ -5774,10 +5772,6 @@ static void dwarf2out_imported_module_or
 						 dw_die_ref);
 static void dwarf2out_abstract_function (tree);
 static void dwarf2out_var_location (rtx);
-static void dwarf2out_direct_call (tree);
-static void dwarf2out_virtual_call_token (tree, int);
-static void dwarf2out_copy_call_info (rtx, rtx);
-static void dwarf2out_virtual_call (int);
 static void dwarf2out_begin_function (tree);
 static void dwarf2out_set_name (tree, tree);
 
@@ -5820,10 +5814,6 @@ const struct gcc_debug_hooks dwarf2_debu
   debug_nothing_int,		/* handle_pch */
   dwarf2out_var_location,
   dwarf2out_switch_text_section,
-  dwarf2out_direct_call,
-  dwarf2out_virtual_call_token,
-  dwarf2out_copy_call_info,
-  dwarf2out_virtual_call,
   dwarf2out_set_name,
   1,                            /* start_end_main_source_file */
   TYPE_SYMTAB_IS_DIE            /* tree_type_symtab_field */
@@ -6263,42 +6253,6 @@ static GTY(()) unsigned int loclabel_num
 /* Unique label counter for point-of-call tables.  */
 static GTY(()) unsigned int poc_label_num;
 
-/* The direct call table structure.  */
-
-typedef struct GTY(()) dcall_struct {
-  unsigned int poc_label_num;
-  tree poc_decl;
-  dw_die_ref targ_die;
-}
-dcall_entry;
-
-DEF_VEC_O(dcall_entry);
-DEF_VEC_ALLOC_O(dcall_entry, gc);
-
-/* The virtual call table structure.  */
-
-typedef struct GTY(()) vcall_struct {
-  unsigned int poc_label_num;
-  unsigned int vtable_slot;
-}
-vcall_entry;
-
-DEF_VEC_O(vcall_entry);
-DEF_VEC_ALLOC_O(vcall_entry, gc);
-
-/* Pointers to the direct and virtual call tables.  */
-static GTY (()) VEC (dcall_entry, gc) * dcall_table = NULL;
-static GTY (()) VEC (vcall_entry, gc) * vcall_table = NULL;
-
-/* A hash table to map INSN_UIDs to vtable slot indexes.  */
-
-struct GTY (()) vcall_insn {
-  int insn_uid;
-  unsigned int vtable_slot;
-};
-
-static GTY ((param_is (struct vcall_insn))) htab_t vcall_insn_table;
-
 /* Record whether the function being analyzed contains inlined functions.  */
 static int current_function_has_inlines;
 
@@ -6642,12 +6596,6 @@ static void gen_scheduled_generic_parms_
 #ifndef DEBUG_PUBTYPES_SECTION
 #define DEBUG_PUBTYPES_SECTION	".debug_pubtypes"
 #endif
-#ifndef DEBUG_DCALL_SECTION
-#define DEBUG_DCALL_SECTION	".debug_dcall"
-#endif
-#ifndef DEBUG_VCALL_SECTION
-#define DEBUG_VCALL_SECTION	".debug_vcall"
-#endif
 #ifndef DEBUG_STR_SECTION
 #define DEBUG_STR_SECTION	".debug_str"
 #endif
@@ -12656,129 +12604,6 @@ output_line_info (void)
   /* Output the marker for the end of the line number info.  */
   ASM_OUTPUT_LABEL (asm_out_file, l2);
 }
-
-/* Return the size of the .debug_dcall table for the compilation unit.  */
-
-static unsigned long
-size_of_dcall_table (void)
-{
-  unsigned long size;
-  unsigned int i;
-  dcall_entry *p;
-  tree last_poc_decl = NULL;
-
-  /* Header:  version + debug info section pointer + pointer size.  */
-  size = 2 + DWARF_OFFSET_SIZE + 1;
-
-  /* Each entry:  code label + DIE offset.  */
-  FOR_EACH_VEC_ELT (dcall_entry, dcall_table, i, p)
-    {
-      gcc_assert (p->targ_die != NULL);
-      /* Insert a "from" entry when the point-of-call DIE offset changes.  */
-      if (p->poc_decl != last_poc_decl)
-        {
-          dw_die_ref poc_die = lookup_decl_die (p->poc_decl);
-          gcc_assert (poc_die);
-          last_poc_decl = p->poc_decl;
-          if (poc_die)
-            size += (DWARF_OFFSET_SIZE
-                     + size_of_uleb128 (poc_die->die_offset));
-        }
-      size += DWARF_OFFSET_SIZE + size_of_uleb128 (p->targ_die->die_offset);
-    }
-
-  return size;
-}
-
-/* Output the direct call table used to disambiguate PC values when
-   identical function have been merged.  */
-
-static void
-output_dcall_table (void)
-{
-  unsigned i;
-  unsigned long dcall_length = size_of_dcall_table ();
-  dcall_entry *p;
-  char poc_label[MAX_ARTIFICIAL_LABEL_BYTES];
-  tree last_poc_decl = NULL;
-
-  if (DWARF_INITIAL_LENGTH_SIZE - DWARF_OFFSET_SIZE == 4)
-    dw2_asm_output_data (4, 0xffffffff,
-      "Initial length escape value indicating 64-bit DWARF extension");
-  dw2_asm_output_data (DWARF_OFFSET_SIZE, dcall_length,
-		       "Length of Direct Call Table");
-  dw2_asm_output_data (2, 4, "Version number");
-  dw2_asm_output_offset (DWARF_OFFSET_SIZE, debug_info_section_label,
-			 debug_info_section,
-			 "Offset of Compilation Unit Info");
-  dw2_asm_output_data (1, DWARF2_ADDR_SIZE, "Pointer Size (in bytes)");
-
-  FOR_EACH_VEC_ELT (dcall_entry, dcall_table, i, p)
-    {
-      /* Insert a "from" entry when the point-of-call DIE offset changes.  */
-      if (p->poc_decl != last_poc_decl)
-        {
-          dw_die_ref poc_die = lookup_decl_die (p->poc_decl);
-          last_poc_decl = p->poc_decl;
-          if (poc_die)
-            {
-              dw2_asm_output_data (DWARF_OFFSET_SIZE, 0, "New caller");
-              dw2_asm_output_data_uleb128 (poc_die->die_offset,
-                                           "Caller DIE offset");
-            }
-        }
-      ASM_GENERATE_INTERNAL_LABEL (poc_label, "LPOC", p->poc_label_num);
-      dw2_asm_output_addr (DWARF_OFFSET_SIZE, poc_label, "Point of call");
-      dw2_asm_output_data_uleb128 (p->targ_die->die_offset,
-                                   "Callee DIE offset");
-    }
-}
-
-/* Return the size of the .debug_vcall table for the compilation unit.  */
-
-static unsigned long
-size_of_vcall_table (void)
-{
-  unsigned long size;
-  unsigned int i;
-  vcall_entry *p;
-
-  /* Header:  version + pointer size.  */
-  size = 2 + 1;
-
-  /* Each entry:  code label + vtable slot index.  */
-  FOR_EACH_VEC_ELT (vcall_entry, vcall_table, i, p)
-    size += DWARF_OFFSET_SIZE + size_of_uleb128 (p->vtable_slot);
-
-  return size;
-}
-
-/* Output the virtual call table used to disambiguate PC values when
-   identical function have been merged.  */
-
-static void
-output_vcall_table (void)
-{
-  unsigned i;
-  unsigned long vcall_length = size_of_vcall_table ();
-  vcall_entry *p;
-  char poc_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
-  if (DWARF_INITIAL_LENGTH_SIZE - DWARF_OFFSET_SIZE == 4)
-    dw2_asm_output_data (4, 0xffffffff,
-      "Initial length escape value indicating 64-bit DWARF extension");
-  dw2_asm_output_data (DWARF_OFFSET_SIZE, vcall_length,
-		       "Length of Virtual Call Table");
-  dw2_asm_output_data (2, 4, "Version number");
-  dw2_asm_output_data (1, DWARF2_ADDR_SIZE, "Pointer Size (in bytes)");
-
-  FOR_EACH_VEC_ELT (vcall_entry, vcall_table, i, p)
-    {
-      ASM_GENERATE_INTERNAL_LABEL (poc_label, "LPOC", p->poc_label_num);
-      dw2_asm_output_addr (DWARF_OFFSET_SIZE, poc_label, "Point of call");
-      dw2_asm_output_data_uleb128 (p->vtable_slot, "Vtable slot");
-    }
-}
 
 /* Given a pointer to a tree node for some base type, return a pointer to
    a DIE that describes the given type.
@@ -22025,135 +21850,6 @@ dwarf2out_set_name (tree decl, tree name
     add_name_attribute (die, dname);
 }
 
-/* Called by the final INSN scan whenever we see a direct function call.
-   Make an entry into the direct call table, recording the point of call
-   and a reference to the target function's debug entry.  */
-
-static void
-dwarf2out_direct_call (tree targ)
-{
-  dcall_entry e;
-  tree origin = decl_ultimate_origin (targ);
-
-  /* If this is a clone, use the abstract origin as the target.  */
-  if (origin)
-    targ = origin;
-
-  e.poc_label_num = poc_label_num++;
-  e.poc_decl = current_function_decl;
-  e.targ_die = force_decl_die (targ);
-  VEC_safe_push (dcall_entry, gc, dcall_table, &e);
-
-  /* Drop a label at the return point to mark the point of call.  */
-  ASM_OUTPUT_DEBUG_LABEL (asm_out_file, "LPOC", e.poc_label_num);
-}
-
-/* Returns a hash value for X (which really is a struct vcall_insn).  */
-
-static hashval_t
-vcall_insn_table_hash (const void *x)
-{
-  return (hashval_t) ((const struct vcall_insn *) x)->insn_uid;
-}
-
-/* Return nonzero if insn_uid of struct vcall_insn *X is the same as
-   insnd_uid of *Y.  */
-
-static int
-vcall_insn_table_eq (const void *x, const void *y)
-{
-  return (((const struct vcall_insn *) x)->insn_uid
-          == ((const struct vcall_insn *) y)->insn_uid);
-}
-
-/* Associate VTABLE_SLOT with INSN_UID in the VCALL_INSN_TABLE.  */
-
-static void
-store_vcall_insn (unsigned int vtable_slot, int insn_uid)
-{
-  struct vcall_insn *item = ggc_alloc_vcall_insn ();
-  struct vcall_insn **slot;
-
-  gcc_assert (item);
-  item->insn_uid = insn_uid;
-  item->vtable_slot = vtable_slot;
-  slot = (struct vcall_insn **)
-      htab_find_slot_with_hash (vcall_insn_table, &item,
-				(hashval_t) insn_uid, INSERT);
-  *slot = item;
-}
-
-/* Return the VTABLE_SLOT associated with INSN_UID.  */
-
-static unsigned int
-lookup_vcall_insn (unsigned int insn_uid)
-{
-  struct vcall_insn item;
-  struct vcall_insn *p;
-
-  item.insn_uid = insn_uid;
-  item.vtable_slot = 0;
-  p = (struct vcall_insn *) htab_find_with_hash (vcall_insn_table,
-                                                 (void *) &item,
-                                                 (hashval_t) insn_uid);
-  if (p == NULL)
-    return (unsigned int) -1;
-  return p->vtable_slot;
-}
-
-
-/* Called when lowering indirect calls to RTL.  We make a note of INSN_UID
-   and the OBJ_TYPE_REF_TOKEN from ADDR.  For C++ virtual calls, the token
-   is the vtable slot index that we will need to put in the virtual call
-   table later.  */
-
-static void
-dwarf2out_virtual_call_token (tree addr, int insn_uid)
-{
-  if (is_cxx() && TREE_CODE (addr) == OBJ_TYPE_REF)
-    {
-      tree token = OBJ_TYPE_REF_TOKEN (addr);
-      if (TREE_CODE (token) == INTEGER_CST)
-        store_vcall_insn (TREE_INT_CST_LOW (token), insn_uid);
-    }
-}
-
-/* Called when scheduling RTL, when a CALL_INSN is split.  Copies the
-   OBJ_TYPE_REF_TOKEN previously associated with OLD_INSN and associates it
-   with NEW_INSN.  */
-
-static void
-dwarf2out_copy_call_info (rtx old_insn, rtx new_insn)
-{
-  unsigned int vtable_slot = lookup_vcall_insn (INSN_UID (old_insn));
-
-  if (vtable_slot != (unsigned int) -1)
-    store_vcall_insn (vtable_slot, INSN_UID (new_insn));
-}
-
-/* Called by the final INSN scan whenever we see a virtual function call.
-   Make an entry into the virtual call table, recording the point of call
-   and the slot index of the vtable entry used to call the virtual member
-   function.  The slot index was associated with the INSN_UID during the
-   lowering to RTL.  */
-
-static void
-dwarf2out_virtual_call (int insn_uid)
-{
-  unsigned int vtable_slot = lookup_vcall_insn (insn_uid);
-  vcall_entry e;
-
-  if (vtable_slot == (unsigned int) -1)
-    return;
-
-  e.poc_label_num = poc_label_num++;
-  e.vtable_slot = vtable_slot;
-  VEC_safe_push (vcall_entry, gc, vcall_table, &e);
-
-  /* Drop a label at the return point to mark the point of call.  */
-  ASM_OUTPUT_DEBUG_LABEL (asm_out_file, "LPOC", e.poc_label_num);
-}
-
 /* Called by the final INSN scan whenever we see a var location.  We
    use it to drop labels in the right places, and throw the location in
    our lookup table.  */
@@ -22569,10 +22265,6 @@ dwarf2out_init (const char *filename ATT
   pubname_table = VEC_alloc (pubname_entry, gc, 32);
   pubtype_table = VEC_alloc (pubname_entry, gc, 32);
 
-  /* Allocate the table that maps insn UIDs to vtable slot indexes.  */
-  vcall_insn_table = htab_create_ggc (10, vcall_insn_table_hash,
-                                      vcall_insn_table_eq, NULL);
-
   incomplete_types = VEC_alloc (tree, gc, 64);
 
   used_rtx_array = VEC_alloc (rtx, gc, 32);
@@ -22593,10 +22285,6 @@ dwarf2out_init (const char *filename ATT
 					SECTION_DEBUG, NULL);
   debug_pubtypes_section = get_section (DEBUG_PUBTYPES_SECTION,
 					SECTION_DEBUG, NULL);
-  debug_dcall_section = get_section (DEBUG_DCALL_SECTION,
-			             SECTION_DEBUG, NULL);
-  debug_vcall_section = get_section (DEBUG_VCALL_SECTION,
-				     SECTION_DEBUG, NULL);
   debug_str_section = get_section (DEBUG_STR_SECTION,
 				   DEBUG_STR_SECTION_FLAGS, NULL);
   debug_ranges_section = get_section (DEBUG_RANGES_SECTION,
@@ -22990,7 +22678,6 @@ prune_unused_types (void)
   limbo_die_node *node;
   comdat_type_node *ctnode;
   pubname_ref pub;
-  dcall_entry *dcall;
 
 #if ENABLE_ASSERT_CHECKING
   /* All the marks should already be clear.  */
@@ -23021,10 +22708,6 @@ prune_unused_types (void)
   for (i = 0; i < arange_table_in_use; i++)
     prune_unused_types_mark (arange_table[i], 1);
 
-  /* Mark nodes referenced from the direct call table.  */
-  FOR_EACH_VEC_ELT (dcall_entry, dcall_table, i, dcall)
-    prune_unused_types_mark (dcall->targ_die, 1);
-
   /* Get rid of nodes that aren't marked; and update the string counts.  */
   if (debug_str_hash && debug_str_hash_forced)
     htab_traverse (debug_str_hash, prune_indirect_string, NULL);
@@ -23944,18 +23627,6 @@ dwarf2out_finish (const char *filename)
 	}
     }
 
-  /* Output direct and virtual call tables if necessary.  */
-  if (!VEC_empty (dcall_entry, dcall_table))
-    {
-      switch_to_section (debug_dcall_section);
-      output_dcall_table ();
-    }
-  if (!VEC_empty (vcall_entry, vcall_table))
-    {
-      switch_to_section (debug_vcall_section);
-      output_vcall_table ();
-    }
-
   /* Output the address range information.  We only put functions in the arange
      table, so don't write it out if we don't have any.  */
   if (arange_table_in_use)
--- gcc/final.c.jj	2011-03-14 21:33:35.000000000 +0100
+++ gcc/final.c	2011-03-15 09:04:40.122402054 +0100
@@ -2679,26 +2679,6 @@ final_scan_insn (rtx insn, FILE *file, i
 	/* Output assembler code from the template.  */
 	output_asm_insn (templ, recog_data.operand);
 
-	/* Record point-of-call information for ICF debugging.  */
-	if (flag_enable_icf_debug && CALL_P (insn))
-	  {
-	    rtx x = call_from_call_insn (insn);
-	    x = XEXP (x, 0);
-	    if (x && MEM_P (x))
-	      {
-	        if (GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
-	          {
-		    tree t;
-		    x = XEXP (x, 0);
-		    t = SYMBOL_REF_DECL (x);
-		    if (t)
-		      (*debug_hooks->direct_call) (t);
-	          }
-	        else
-	          (*debug_hooks->virtual_call) (INSN_UID (insn));
-	      }
-	  }
-
 	/* Some target machines need to postscan each insn after
 	   it is output.  */
 	if (targetm.asm_out.final_postscan_insn)
--- gcc/sdbout.c.jj	2010-12-02 13:15:24.000000000 +0100
+++ gcc/sdbout.c	2011-03-15 09:09:22.473526982 +0100
@@ -339,10 +339,6 @@ const struct gcc_debug_hooks sdb_debug_h
   debug_nothing_int,		         /* 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 */
   TYPE_SYMTAB_IS_POINTER                 /* tree_type_symtab_field */
--- gcc/vmsdbgout.c.jj	2011-01-01 16:28:01.000000000 +0100
+++ gcc/vmsdbgout.c	2011-03-15 09:10:00.129465023 +0100
@@ -205,10 +205,6 @@ const struct gcc_debug_hooks vmsdbg_debu
    debug_nothing_int,		  /* 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 */
    TYPE_SYMTAB_IS_ADDRESS         /* tree_type_symtab_field */
--- gcc/doc/invoke.texi.jj	2011-03-14 08:28:27.000000000 +0100
+++ gcc/doc/invoke.texi	2011-03-15 09:34:33.947670984 +0100
@@ -313,7 +313,6 @@ Objective-C and Objective-C++ Dialects}.
 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
--fenable-icf-debug @gol
 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
@@ -4810,11 +4809,6 @@ The default is @samp{-femit-struct-debug
 
 This option works only with DWARF 2.
 
-@item -fenable-icf-debug
-@opindex fenable-icf-debug
-Generate additional debug information to support identical code folding (ICF).
-This option only works with DWARF version 2 or higher.
-
 @item -fno-merge-debug-strings
 @opindex fmerge-debug-strings
 @opindex fno-merge-debug-strings
--- gcc/common.opt.jj	2011-03-06 12:20:28.000000000 +0100
+++ gcc/common.opt	2011-03-15 09:05:21.821402007 +0100
@@ -1012,10 +1012,6 @@ femit-class-debug-always
 Common Report Var(flag_emit_class_debug_always) Init(0)
 Do not suppress C++ class debug information.
 
-fenable-icf-debug
-Common Report Var(flag_enable_icf_debug)
-Generate debug information to support Identical Code Folding (ICF)
-
 fexceptions
 Common Report Var(flag_exceptions) Optimization
 Enable exception handling
--- gcc/debug.h.jj	2010-11-15 23:28:02.000000000 +0100
+++ gcc/debug.h	2011-03-15 09:07:59.303526969 +0100
@@ -133,31 +133,6 @@ struct gcc_debug_hooks
      text sections.  */
   void (* switch_text_section) (void);
 
-  /* Records a direct call to the function DECL, noting the point of call
-     and the debug info for the function.  Called from final_scan_insn
-     when ICF debugging is enabled.  */
-  void (* direct_call) (tree decl);
-
-  /* Records the OBJ_TYPE_REF_TOKEN for a virtual call through ADDR, which
-     for C++ is the vtable slot index, noting the INSN_UID for the call
-     instruction.  Called from calls.c:emit_call_1 when ICF debugging is
-     enabled.  It's necessary to do this during lowering because the
-     call instruction and the OBJ_TYPE_REF become separated after that
-     point.  */
-  void (* virtual_call_token) (tree addr, int insn_uid);
-
-  /* Copies the OBJ_TYPE_REF_TOKEN for a virtual call from OLD_INSN to
-     NEW_INSN.  Called from emit-rtl.c:try_split when a CALL_INSN is
-     split, so that the vtable slot index remains associated with the
-     new CALL_INSN.  */
-  void (* copy_call_info) (rtx old_insn, rtx new_insn);
-
-  /* Records a virtual call given INSN_UID, which is the UID of the call
-     instruction.  The UID is then mapped to the vtable slot index noted
-     during the lowering phase.  Called from final_scan_insn when ICF
-     debugging is enabled.  */
-  void (* virtual_call) (int insn_uid);
-
   /* Called from grokdeclarator.  Replaces the anonymous name with the
      type name.  */
   void (* set_name) (tree, tree);
@@ -188,7 +163,6 @@ extern void debug_nothing_tree_tree_tree
 extern bool debug_true_const_tree (const_tree);
 extern void debug_nothing_rtx (rtx);
 extern void debug_nothing_rtx_rtx (rtx, rtx);
-extern void debug_nothing_uid (int);
 
 /* Hooks for various debug formats.  */
 extern const struct gcc_debug_hooks do_nothing_debug_hooks;
--- gcc/dbxout.c.jj	2010-12-23 10:25:41.000000000 +0100
+++ gcc/dbxout.c	2011-03-15 09:09:00.091526912 +0100
@@ -379,10 +379,6 @@ const struct gcc_debug_hooks dbx_debug_h
   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 */
   TYPE_SYMTAB_IS_ADDRESS                 /* tree_type_symtab_field */
@@ -419,10 +415,6 @@ const struct gcc_debug_hooks xcoff_debug
   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 */
   TYPE_SYMTAB_IS_ADDRESS                 /* tree_type_symtab_field */
--- gcc/debug.c.jj	2010-11-15 23:28:02.000000000 +0100
+++ gcc/debug.c	2011-03-15 09:08:25.096433912 +0100
@@ -53,10 +53,6 @@ const struct gcc_debug_hooks do_nothing_
   debug_nothing_int,		         /* 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 */
   TYPE_SYMTAB_IS_ADDRESS                 /* tree_type_symtab_field */
@@ -141,8 +137,3 @@ debug_nothing_tree_int (tree decl ATTRIB
 			int local ATTRIBUTE_UNUSED)
 {
 }
-
-void
-debug_nothing_uid (int uid ATTRIBUTE_UNUSED)
-{
-}
--- gcc/testsuite/g++.dg/debug/dwarf2/icf.C.jj	2010-06-11 11:01:14.000000000 +0200
+++ gcc/testsuite/g++.dg/debug/dwarf2/icf.C	2011-03-15 09:37:57.453870704 +0100
@@ -1,6 +1,5 @@
-// Test support for ICF debugging. 
 // { dg-do compile }
-// { dg-options "-O0 -gdwarf-2 -fenable-icf-debug -dA" }
+// { dg-options "-O1 -gdwarf-2 -gno-dwarf-strict -fno-inline -dA" }
 
 class A
 {
@@ -37,14 +36,3 @@ test2(A* a)
       b.work(a);
     }
 }
-
-// Verify that we get .debug_dcall and .debug_vcall tables generated
-// and that we see entries for both virtual calls. 
-// { dg-final { scan-assembler "\\.section.*\.debug_dcall" } }
-// { dg-final { scan-assembler "\\.section.*\.debug_vcall" } }
-// { dg-final { scan-assembler "New caller" } }
-// { dg-final { scan-assembler "Caller DIE offset" } }
-// { dg-final { scan-assembler "Point of call" } }
-// { dg-final { scan-assembler "Callee DIE offset" } }
-// { dg-final { scan-assembler "0\[ \t\]+.*Vtable slot" } }
-// { dg-final { scan-assembler "0x1\[ \t\]+.*Vtable slot" } }

	Jakub


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