Annotate debug functions to prevent -fwhole-program to optimize them out

Jan Hubicka hubicka@ucw.cz
Sat May 29 20:32:00 GMT 2010


Hi,
this ultra-boring patch annotates debug function with DEBUG_FUNCTION that
expands to __attribute__ ((__used__)) for GCC 4.0 and newer.

This is to make LTO -fwhole-program binary debugeable, since we eliminate
them as dead otherwise.

I made no serious attempt to annotate all possible functions we want to call
from gdb, just those called debug_, verify_ and those used by gdb macros. I
also did not look into frontends.  Hope it is sufficient for first cut.

Bootstrapped/regtested x86_64-linux, OK?

	* tree-vrp.c (debug_value_range, debug_all_value_ranges,
	debug_asserts_for, debug_all_asserts): Annotate with DEBUG_FUNCTION.
	* sched-ebb.c (debug_ebb_dependencies): Likewise.
	* tree-into-ssa.c (debug_decl_set, debug_defs_stack, debug_currdefs,
	debug_tree_ssa, debug_tree_ssa_stats, debug_def_blocks,
	debug_names_replaced_by, debug_update_ssa): Likewise.	
	* sbitmap.c (debug_sbitmap): Likewise.
	* genrecog.c (debug_decision, debug_decision_list): Likewise.
	* tree-pretty-print.c (debug_generic_expr, debug_generic_stmt,
	debug_tree_chain): Likewise.
	* tree-loop-distribution.c (debug_rdg_partitions): Likewise.
	* cgraph.c (debug_cgraph_node, debug_cgraph): Likewise.
	* optabs.c  (debug_optab_libfuncs): Likewise.
	(verify_loop_closed_ssa): Likewise.
	* value-prof.c (verify_histograms): Likewise.
	* reload.c (debug_reload_to_stream, debug_reload): Likewise.
	* bitmap.c (debug_bitmap_file, debug_bitmap, bitmap_print): Likewise.
	* cfghooks.c (verify_flow_info): Likewise.
	* fold-const.c (debug_fold_checksum): Likewise.
	* omp-low.c (debug_omp_region, debug_all_omp_regions): Likewise.
	* cfg.c (debug_regset, debug_flow_info, debug_bb, debug_bb_n):
	Likewise.
	* omega.c (debug_omega_problem): Likewise.
	* cgraphunit.c (verify_cgraph_node, verify_cgraph): Likewise.
	* tree-ssa-ccp.c (debug_lattice_value): Likewise.
	* dominance.c (verify_dominators, debug_dominance_info,
	debug_dominance_tree): Likewise.
	* df-core.c (df_insn_uid_debug, df_insn_debug, df_insn_debug_regno,
	* df_regno_debug, df_ref_debug,
	debug_df_insn, debug_df_reg, debug_df_regno, debug_df_ref,
	debug_df_defno, debug_df_useno, debug_df_chain): Likewise.
	* tree-ssa-dom.c (debug_dominator_optimization_stats): Likewise.
	* sel-sched.c (debug_state): Likewise.
	* tree-ssa-alias.c (debug_alias_info, debug_points_to_info_for): Likewise.
	* cfganal.c (print_edge_list, verify_edge_list): Likewise.
	* dwarf2out.c (debug_dwarf_die, debug_dwarf): Likewise.
	* tree-eh.c (verify_eh_edges, verify_eh_dispatch_edge): Likewise.
	* gimple-pretty-print.c (debug_gimple_stmt, debug_gimple_seq): Likewise.
	* c-pretty-print.c (debug_c_tree): Likewise.
	* sel-sched-dump.c (debug_insn_rtx, debug_vinsn, debug_expr, debug_insn
	debug_av_set, debug_lv_set, debug_ilist, debug_blist, debug_insn_vector,
	debug_hard_reg_set, debug_mem_addr_value): Likewise.
	* ebitmap.c (debug_ebitmap): Likewise.
	* function.c (debug_find_var_in_block_tree): Likewise.
	* print-rtl.c (debug_rtx): Likewise.
	(debug_rtx_count): Likewise.
	(debug_rtx_list, debug_rtx_range, debug_rtx_find): Likewise.
	* stor-layout.c (debug_rli): Likewise.
	* ipa.c (debug_cgraph_node_set, debug_varpool_node_set): Likewise.
	* tree-data-ref.c (debug_data_references, debug_data_dependence_relations,
	debug_data_reference, debug_data_dependence_relation, debug_rdg_vertex,
	debug_rdg_component, debug_rdg): Likewise.
	* tree-affine.c (debug_aff): Likewise.
	* tree-dfa.c (debug_referenced_vars, debug_variable, debug_dfa_stats): Likewise.
	* except.c (debug_eh_tree, verify_eh_tree): Likewise.
	* emit-rtl.c (verify_rtl_sharing): Likewise.
	* tree-ssa-pre.c (debug_pre_expr, debug_bitmap_set,
	debug_value_expressions): Likewise.
	* tree-ssa-live.c (debug_scope_block, debug_scope_blocks): Likewise.
	* sese.c (debug_rename_map, debug_ivtype_map): Likewise.
	* print-tree.c (debug_tree, debug_vec_tree): Likewise.
	* cfglayout.c (verify_insn_chain): Likewise.
	* graphite-clast-to-gimple.c (debug_clast_name_indexes,
	debug_clast_stmt, debug_generated_program): Likewise.
	* ggc-page.c (debug_print_page_list): Likewise.
	* tree-ssa-ter.c (debug_ter): Likewise.
	* graphite-dependences.c (debug_pddr): Likewise.
	* sched-deps.c (debug_ds): Likewise.
	* tree-ssa.c (verify_ssa): Likewise.
	* graphite-poly.c (debug_scattering_function, debug_iteration_domain,
	debug_scattering_functions, debug_iteration_domains, debug_pdr,
	debug_pdrs, debug_pbb_domain, debug_pbb, debug_scop_context, debug_scop,
	debug_cloog, debug_scop_params, debug_lst): Likewise.
	* tree-inline.c (debug_find_tree): Likewise.
	* graphite-ppl.c (debug_ppl_linear_expr, debug_ppl_polyhedron_matrix,
	debug_ppl_powerset_matrix): Likewise.
	* var-tracking.c (debug_dv): Likewise.
	* system.h (DEBUG_FUNCTION, DEBUG_VARIABLE): Define.
	* cfgloop.c (verify_loop_structure): Likewise.
	* plugin.c (dump_active_plugins, debug_active_plugins): Likewise.
	* c-common.c (verify_sequence_points): Likewise.
	* sched-rgn.c (debug_regions, debug_region, debug_candidate,
	debug_candidates, debug_rgn_dependencies): Likewise.
	* tree-ssa-structalias.c (debug_constraint, debug_constraints,
	* debug_constraint_graph, debug_solution_for_var,
	debug_sa_points_to_info): Likewise.
	* sched-vis.c (debug_insn_slim, debug_bb_slim, debug_bb_n_slim):
	Likewie.
	* tree-cfg.c (debug_cfg_stats, verify_stmts, debug_function,
	debug_loops, debug_loop, debug_loop_num): Likewise.
	* passes.c (debug_pass): Likewise.
	(dump_properties): Likewise; add cfglayout property.
	(debug_properties): Likewise.
	* tree-ssa-reassoc.c (debug_ops_vector): Likewise.
	* varpool.c (debug_varpool): Likewise.
	* regcprop.c (debug_value_data): Likewise.
	* tree-ssa-operands.c (verify_imm_links, debug_immediate_uses,
	debug_immediate_uses_for): Likewise.
Index: tree-vrp.c
===================================================================
--- tree-vrp.c	(revision 160033)
+++ tree-vrp.c	(working copy)
@@ -3747,7 +3747,7 @@
 
 /* Dump value range VR to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_value_range (value_range_t *vr)
 {
   dump_value_range (stderr, vr);
@@ -3779,7 +3779,7 @@
 
 /* Dump all value ranges to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_all_value_ranges (void)
 {
   dump_all_value_ranges (stderr);
@@ -3935,7 +3935,7 @@
 
 /* Dump all the registered assertions for NAME to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_asserts_for (tree name)
 {
   dump_asserts_for (stderr, name);
@@ -3959,7 +3959,7 @@
 
 /* Dump all the registered assertions for all the names to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_all_asserts (void)
 {
   dump_all_asserts (stderr);
Index: sched-ebb.c
===================================================================
--- sched-ebb.c	(revision 160033)
+++ sched-ebb.c	(working copy)
@@ -84,7 +84,7 @@
 }
 
 /* Print dependency information about ebb between HEAD and TAIL.  */
-static void
+DEBUG_FUNCTION static void
 debug_ebb_dependencies (rtx head, rtx tail)
 {
   fprintf (sched_dump,
Index: tree-into-ssa.c
===================================================================
--- tree-into-ssa.c	(revision 160033)
+++ tree-into-ssa.c	(working copy)
@@ -1494,7 +1494,7 @@
 
 /* Dump bitmap SET (assumed to contain VAR_DECLs) to FILE.  */
 
-void
+DEBUG_FUNCTION void
 debug_decl_set (bitmap set)
 {
   dump_decl_set (stderr, set);
@@ -1565,7 +1565,7 @@
    dumped.  New levels are created when the dominator tree traversal
    used for renaming enters a new sub-tree.  */
 
-void
+DEBUG_FUNCTION void
 debug_defs_stack (int n)
 {
   dump_defs_stack (stderr, n);
@@ -1599,7 +1599,7 @@
 
 /* Dump the current reaching definition of every symbol to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_currdefs (void)
 {
   dump_currdefs (stderr);
@@ -1625,7 +1625,7 @@
 
 /* Dump SSA information to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_tree_ssa (void)
 {
   dump_tree_ssa (stderr);
@@ -1671,7 +1671,7 @@
 
 /* Dump SSA statistics on stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_tree_ssa_stats (void)
 {
   dump_tree_ssa_stats (stderr);
@@ -1739,7 +1739,7 @@
 
 /* Dump the DEF_BLOCKS hash table on stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_def_blocks (void)
 {
   dump_def_blocks (stderr);
@@ -2692,7 +2692,7 @@
 
 /* Dump all the names replaced by NAME to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_names_replaced_by (tree name)
 {
   dump_names_replaced_by (stderr, name);
@@ -2757,7 +2757,7 @@
 
 /* Dump SSA update information to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_update_ssa (void)
 {
   dump_update_ssa (stderr);
Index: sbitmap.c
===================================================================
--- sbitmap.c	(revision 160033)
+++ sbitmap.c	(working copy)
@@ -1011,7 +1011,7 @@
   fprintf (file, "}\n");
 }
 
-void
+DEBUG_FUNCTION void
 debug_sbitmap (const_sbitmap bmap)
 {
   dump_sbitmap_file (stderr, bmap);
Index: genrecog.c
===================================================================
--- genrecog.c	(revision 160033)
+++ genrecog.c	(working copy)
@@ -2897,13 +2897,13 @@
     debug_decision_0 (n, indent + 2, maxdepth - 1);
 }
 
-void
+DEBUG_FUNCTION void
 debug_decision (struct decision *d)
 {
   debug_decision_0 (d, 0, 1000000);
 }
 
-void
+DEBUG_FUNCTION void
 debug_decision_list (struct decision *d)
 {
   while (d)
Index: tree-pretty-print.c
===================================================================
--- tree-pretty-print.c	(revision 160033)
+++ tree-pretty-print.c	(working copy)
@@ -77,7 +77,7 @@
 
 /* Debugging function to print out a generic expression.  */
 
-void
+DEBUG_FUNCTION void
 debug_generic_expr (tree t)
 {
   print_generic_expr (stderr, t, TDF_VOPS|TDF_MEMSYMS);
@@ -86,7 +86,7 @@
 
 /* Debugging function to print out a generic statement.  */
 
-void
+DEBUG_FUNCTION void
 debug_generic_stmt (tree t)
 {
   print_generic_stmt (stderr, t, TDF_VOPS|TDF_MEMSYMS);
@@ -95,7 +95,7 @@
 
 /* Debugging function to print out a chain of trees .  */
 
-void
+DEBUG_FUNCTION void
 debug_tree_chain (tree t)
 {
   struct pointer_set_t *seen = pointer_set_create ();
Index: tree-loop-distribution.c
===================================================================
--- tree-loop-distribution.c	(revision 160033)
+++ tree-loop-distribution.c	(working copy)
@@ -970,7 +970,7 @@
 /* Debug PARTITIONS.  */
 extern void debug_rdg_partitions (VEC (bitmap, heap) *);
 
-void
+DEBUG_FUNCTION void
 debug_rdg_partitions (VEC (bitmap, heap) *partitions)
 {
   dump_rdg_partitions (stderr, partitions);
Index: cgraph.c
===================================================================
--- cgraph.c	(revision 160033)
+++ cgraph.c	(working copy)
@@ -1915,7 +1915,7 @@
 
 /* Dump call graph node NODE to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_cgraph_node (struct cgraph_node *node)
 {
   dump_cgraph_node (stderr, node);
@@ -1937,7 +1937,7 @@
 
 /* Dump the call graph to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_cgraph (void)
 {
   dump_cgraph (stderr);
Index: optabs.c
===================================================================
--- optabs.c	(revision 160033)
+++ optabs.c	(working copy)
@@ -6676,7 +6676,7 @@
 /* Print information about the current contents of the optabs on
    STDERR.  */
 
-void
+DEBUG_FUNCTION void
 debug_optab_libfuncs (void)
 {
   int i;
Index: tree-ssa-loop-manip.c
===================================================================
--- tree-ssa-loop-manip.c	(revision 160033)
+++ tree-ssa-loop-manip.c	(working copy)
@@ -441,7 +441,7 @@
 /* Checks that invariants of the loop closed ssa form are preserved.
    Call verify_ssa when VERIFY_SSA_P is true.  */
 
-void
+DEBUG_FUNCTION void
 verify_loop_closed_ssa (bool verify_ssa_p)
 {
   basic_block bb;
Index: value-prof.c
===================================================================
--- value-prof.c	(revision 160033)
+++ value-prof.c	(working copy)
@@ -386,7 +386,7 @@
 
 /* Verify sanity of the histograms.  */
 
-void
+DEBUG_FUNCTION void
 verify_histograms (void)
 {
   basic_block bb;
Index: reload.c
===================================================================
--- reload.c	(revision 160033)
+++ reload.c	(working copy)
@@ -7337,7 +7337,7 @@
 
 /* These functions are used to print the variables set by 'find_reloads' */
 
-void
+DEBUG_FUNCTION void
 debug_reload_to_stream (FILE *f)
 {
   int r;
@@ -7432,7 +7432,7 @@
     }
 }
 
-void
+DEBUG_FUNCTION void
 debug_reload (void)
 {
   debug_reload_to_stream (stderr);
Index: bitmap.c
===================================================================
--- bitmap.c	(revision 160033)
+++ bitmap.c	(working copy)
@@ -2023,7 +2023,7 @@
 
 /* Debugging function to print out the contents of a bitmap.  */
 
-void
+DEBUG_FUNCTION void
 debug_bitmap_file (FILE *file, const_bitmap head)
 {
   const bitmap_element *ptr;
@@ -2063,7 +2063,7 @@
 /* Function to be called from the debugger to print the contents
    of a bitmap.  */
 
-void
+DEBUG_FUNCTION void
 debug_bitmap (const_bitmap head)
 {
   debug_bitmap_file (stdout, head);
@@ -2072,7 +2072,7 @@
 /* Function to print out the contents of a bitmap.  Unlike debug_bitmap_file,
    it does not print anything but the bits.  */
 
-void
+DEBUG_FUNCTION void
 bitmap_print (FILE *file, const_bitmap head, const char *prefix, const char *suffix)
 {
   const char *comma = "";
Index: cfghooks.c
===================================================================
--- cfghooks.c	(revision 160033)
+++ cfghooks.c	(working copy)
@@ -88,7 +88,7 @@
    Currently it does following: checks edge and basic block list correctness
    and calls into IL dependent checking then.  */
 
-void
+DEBUG_FUNCTION void
 verify_flow_info (void)
 {
   size_t *edge_checksum;
Index: fold-const.c
===================================================================
--- fold-const.c	(revision 160033)
+++ fold-const.c	(working copy)
@@ -13768,7 +13768,7 @@
    by "call debug_fold_checksum (op0)", then just trace down till the
    outputs differ.  */
 
-void
+DEBUG_FUNCTION void
 debug_fold_checksum (const_tree t)
 {
   int i;
Index: omp-low.c
===================================================================
--- omp-low.c	(revision 160033)
+++ omp-low.c	(working copy)
@@ -1112,13 +1112,13 @@
     dump_omp_region (file, region->next, indent);
 }
 
-void
+DEBUG_FUNCTION void
 debug_omp_region (struct omp_region *region)
 {
   dump_omp_region (stderr, region, 0);
 }
 
-void
+DEBUG_FUNCTION void
 debug_all_omp_regions (void)
 {
   dump_omp_region (stderr, root_omp_region, 0);
Index: cfg.c
===================================================================
--- cfg.c	(revision 160033)
+++ cfg.c	(working copy)
@@ -514,7 +514,7 @@
    stream.  This function is designed to be used from within the
    debugger.  */
 
-void
+DEBUG_FUNCTION void
 debug_regset (regset r)
 {
   dump_regset (r, stderr);
@@ -668,7 +668,7 @@
   putc ('\n', file);
 }
 
-void
+DEBUG_FUNCTION void
 debug_flow_info (void)
 {
   dump_flow_info (stderr, TDF_DETAILS);
@@ -868,13 +868,13 @@
   clear_aux_for_edges ();
 }
 
-void
+DEBUG_FUNCTION void
 debug_bb (basic_block bb)
 {
   dump_bb (bb, stderr, 0);
 }
 
-basic_block
+DEBUG_FUNCTION basic_block
 debug_bb_n (int n)
 {
   basic_block bb = BASIC_BLOCK (n);
Index: omega.c
===================================================================
--- omega.c	(revision 160033)
+++ omega.c	(working copy)
@@ -363,7 +363,7 @@
 
 /* Debug problem PB.  */
 
-void
+DEBUG_FUNCTION void
 debug_omega_problem (omega_pb pb)
 {
   omega_print_problem (stderr, pb);
Index: cgraphunit.c
===================================================================
--- cgraphunit.c	(revision 160033)
+++ cgraphunit.c	(working copy)
@@ -569,7 +569,7 @@
 #endif
 
 /* Verify cgraph nodes of given cgraph node.  */
-void
+DEBUG_FUNCTION void
 verify_cgraph_node (struct cgraph_node *node)
 {
   struct cgraph_edge *e;
@@ -878,7 +878,7 @@
 }
 
 /* Verify whole cgraph structure.  */
-void
+DEBUG_FUNCTION void
 verify_cgraph (void)
 {
   struct cgraph_node *node;
Index: tree-ssa-ccp.c
===================================================================
--- tree-ssa-ccp.c	(revision 160033)
+++ tree-ssa-ccp.c	(working copy)
@@ -261,7 +261,7 @@
 
 void debug_lattice_value (prop_value_t val);
 
-void
+DEBUG_FUNCTION void
 debug_lattice_value (prop_value_t val)
 {
   dump_lattice_value (stderr, "", val);
Index: dominance.c
===================================================================
--- dominance.c	(revision 160033)
+++ dominance.c	(working copy)
@@ -989,7 +989,7 @@
 }
 
 /* Verify invariants of dominator structure.  */
-void
+DEBUG_FUNCTION void
 verify_dominators (enum cdi_direction dir)
 {
   int err = 0;
@@ -1466,7 +1466,7 @@
   return dom_computed[dir_index] != DOM_NONE;
 }
 
-void
+DEBUG_FUNCTION void
 debug_dominance_info (enum cdi_direction dir)
 {
   basic_block bb, bb2;
@@ -1507,7 +1507,7 @@
 /* Prints to stderr representation of the dominance tree (for direction DIR)
    rooted in ROOT.  */
 
-void
+DEBUG_FUNCTION void
 debug_dominance_tree (enum cdi_direction dir, basic_block root)
 {
   debug_dominance_tree_1 (dir, root, 0, false);
Index: df-core.c
===================================================================
--- df-core.c	(revision 160033)
+++ df-core.c	(working copy)
@@ -2060,7 +2060,7 @@
 }
 
 
-static void
+DEBUG_FUNCTION static void
 df_insn_uid_debug (unsigned int uid,
 		   bool follow_chain, FILE *file)
 {
@@ -2094,13 +2094,13 @@
 }
 
 
-void
+DEBUG_FUNCTION void
 df_insn_debug (rtx insn, bool follow_chain, FILE *file)
 {
   df_insn_uid_debug (INSN_UID (insn), follow_chain, file);
 }
 
-void
+DEBUG_FUNCTION void
 df_insn_debug_regno (rtx insn, FILE *file)
 {
   struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
@@ -2118,7 +2118,7 @@
   fprintf (file, "\n");
 }
 
-void
+DEBUG_FUNCTION void
 df_regno_debug (unsigned int regno, FILE *file)
 {
   fprintf (file, "reg %d defs ", regno);
@@ -2131,7 +2131,7 @@
 }
 
 
-void
+DEBUG_FUNCTION void
 df_ref_debug (df_ref ref, FILE *file)
 {
   fprintf (file, "%c%d ",
@@ -2159,7 +2159,7 @@
 
 /* Functions for debugging from GDB.  */
 
-void
+DEBUG_FUNCTION void
 debug_df_insn (rtx insn)
 {
   df_insn_debug (insn, true, stderr);
@@ -2167,42 +2167,42 @@
 }
 
 
-void
+DEBUG_FUNCTION void
 debug_df_reg (rtx reg)
 {
   df_regno_debug (REGNO (reg), stderr);
 }
 
 
-void
+DEBUG_FUNCTION void
 debug_df_regno (unsigned int regno)
 {
   df_regno_debug (regno, stderr);
 }
 
 
-void
+DEBUG_FUNCTION void
 debug_df_ref (df_ref ref)
 {
   df_ref_debug (ref, stderr);
 }
 
 
-void
+DEBUG_FUNCTION void
 debug_df_defno (unsigned int defno)
 {
   df_ref_debug (DF_DEFS_GET (defno), stderr);
 }
 
 
-void
+DEBUG_FUNCTION void
 debug_df_useno (unsigned int defno)
 {
   df_ref_debug (DF_USES_GET (defno), stderr);
 }
 
 
-void
+DEBUG_FUNCTION void
 debug_df_chain (struct df_link *link)
 {
   df_chain_dump (link, stderr);
Index: tree-ssa-dom.c
===================================================================
--- tree-ssa-dom.c	(revision 160033)
+++ tree-ssa-dom.c	(working copy)
@@ -1042,7 +1042,7 @@
 
 /* Dump SSA statistics on stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_dominator_optimization_stats (void)
 {
   dump_dominator_optimization_stats (stderr);
Index: sel-sched.c
===================================================================
--- sel-sched.c	(revision 160033)
+++ sel-sched.c	(working copy)
@@ -5229,7 +5229,7 @@
 
 
 /* Debug a DFA state as an array of bytes.  */
-static void
+DEBUG_FUNCTION static void
 debug_state (state_t state)
 {
   unsigned char *p;
Index: tree-ssa-alias.c
===================================================================
--- tree-ssa-alias.c	(revision 160033)
+++ tree-ssa-alias.c	(working copy)
@@ -358,7 +358,7 @@
 
 /* Dump alias information on stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_alias_info (void)
 {
   dump_alias_info (stderr);
@@ -437,7 +437,7 @@
 
 /* Dump points-to information for VAR into stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_points_to_info_for (tree var)
 {
   dump_points_to_info_for (stderr, var);
Index: cfganal.c
===================================================================
--- cfganal.c	(revision 160033)
+++ cfganal.c	(working copy)
@@ -389,7 +389,7 @@
 
 /* This function provides debug output showing an edge list.  */
 
-void
+DEBUG_FUNCTION void
 print_edge_list (FILE *f, struct edge_list *elist)
 {
   int x;
@@ -416,7 +416,7 @@
    verifying that all edges are present, and that there are no
    extra edges.  */
 
-void
+DEBUG_FUNCTION void
 verify_edge_list (FILE *f, struct edge_list *elist)
 {
   int pred, succ, index;
Index: dwarf2out.c
===================================================================
--- dwarf2out.c	(revision 160033)
+++ dwarf2out.c	(working copy)
@@ -8239,7 +8239,7 @@
 
 /* Print the information collected for a given DIE.  */
 
-void
+DEBUG_FUNCTION void
 debug_dwarf_die (dw_die_ref die)
 {
   print_die (die, stderr);
@@ -8248,7 +8248,7 @@
 /* Print all DWARF information collected for the compilation unit.
    This routine is a debugging aid only.  */
 
-void
+DEBUG_FUNCTION void
 debug_dwarf (void)
 {
   print_indent = 0;
Index: tree-eh.c
===================================================================
--- tree-eh.c	(revision 160033)
+++ tree-eh.c	(working copy)
@@ -3918,7 +3918,7 @@
 /* Verify that BB containing STMT as the last statement, has precisely the
    edge that make_eh_edges would create.  */
 
-bool
+DEBUG_FUNCTION bool
 verify_eh_edges (gimple stmt)
 {
   basic_block bb = gimple_bb (stmt);
@@ -3979,7 +3979,7 @@
 
 /* Similarly, but handle GIMPLE_EH_DISPATCH specifically.  */
 
-bool
+DEBUG_FUNCTION bool
 verify_eh_dispatch_edge (gimple stmt)
 {
   eh_region r;
Index: gimple-pretty-print.c
===================================================================
--- gimple-pretty-print.c	(revision 160033)
+++ gimple-pretty-print.c	(working copy)
@@ -81,7 +81,7 @@
 
 /* Print the GIMPLE statement GS on stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_gimple_stmt (gimple gs)
 {
   print_gimple_stmt (stderr, gs, 0, TDF_VOPS|TDF_MEMSYMS);
@@ -147,7 +147,7 @@
 
 /* Print the GIMPLE sequence SEQ on stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_gimple_seq (gimple_seq seq)
 {
   print_gimple_seq (stderr, seq, 0, TDF_VOPS|TDF_MEMSYMS);
Index: c-pretty-print.c
===================================================================
--- c-pretty-print.c	(revision 160033)
+++ c-pretty-print.c	(working copy)
@@ -2231,7 +2231,7 @@
 
 /* Print the tree T in full, on stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_c_tree (tree t)
 {
   print_c_tree (stderr, t);
Index: sel-sched-dump.c
===================================================================
--- sel-sched-dump.c	(revision 160033)
+++ sel-sched-dump.c	(working copy)
@@ -164,7 +164,7 @@
 
 
 /* Dump INSN to stderr.  */
-void
+DEBUG_FUNCTION void
 debug_insn_rtx (rtx insn)
 {
   switch_dump (stderr);
@@ -214,7 +214,7 @@
 }
 
 /* Dump vinsn VI to stderr.  */
-void
+DEBUG_FUNCTION void
 debug_vinsn (vinsn_t vi)
 {
   switch_dump (stderr);
@@ -295,7 +295,7 @@
 }
 
 /* Dump expression EXPR to stderr.  */
-void
+DEBUG_FUNCTION void
 debug_expr (expr_t expr)
 {
   switch_dump (stderr);
@@ -353,7 +353,7 @@
 }
 
 /* Dump INSN to stderr.  */
-void
+DEBUG_FUNCTION void
 debug_insn (insn_t insn)
 {
   switch_dump (stderr);
@@ -861,7 +861,7 @@
 }
 
 /* Dumps av_set AV to stderr.  */
-void
+DEBUG_FUNCTION void
 debug_av_set (av_set_t av)
 {
   switch_dump (stderr);
@@ -871,7 +871,7 @@
 }
 
 /* Dump LV to stderr.  */
-void
+DEBUG_FUNCTION void
 debug_lv_set (regset lv)
 {
   switch_dump (stderr);
@@ -881,7 +881,7 @@
 }
 
 /* Dump an instruction list P to stderr.  */
-void
+DEBUG_FUNCTION void
 debug_ilist (ilist_t p)
 {
   switch_dump (stderr);
@@ -891,7 +891,7 @@
 }
 
 /* Dump a boundary list BNDS to stderr.  */
-void
+DEBUG_FUNCTION void
 debug_blist (blist_t bnds)
 {
   switch_dump (stderr);
@@ -901,7 +901,7 @@
 }
 
 /* Dump an insn vector SUCCS.  */
-void
+DEBUG_FUNCTION void
 debug_insn_vector (rtx_vec_t succs)
 {
   switch_dump (stderr);
@@ -911,7 +911,7 @@
 }
 
 /* Dump a hard reg set SET to stderr.  */
-void
+DEBUG_FUNCTION void
 debug_hard_reg_set (HARD_REG_SET set)
 {
   switch_dump (stderr);
@@ -928,7 +928,7 @@
 }
 
 /* Print a current cselib value for X's address to stderr.  */
-rtx
+DEBUG_FUNCTION rtx
 debug_mem_addr_value (rtx x)
 {
   rtx t, addr;
Index: ebitmap.c
===================================================================
--- ebitmap.c	(revision 160033)
+++ ebitmap.c	(working copy)
@@ -410,7 +410,7 @@
 
 /* Dump ebitmap BMAP to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_ebitmap (ebitmap bmap)
 {
   dump_ebitmap (stderr, bmap);
Index: function.c
===================================================================
--- function.c	(revision 160033)
+++ function.c	(working copy)
@@ -4084,7 +4084,7 @@
 
 /* If VAR is present in a subblock of BLOCK, return the subblock.  */
 
-tree
+DEBUG_FUNCTION tree
 debug_find_var_in_block_tree (tree var, tree block)
 {
   tree t;
Index: print-rtl.c
===================================================================
--- print-rtl.c	(revision 160033)
+++ print-rtl.c	(working copy)
@@ -626,7 +626,7 @@
 
 /* Call this function from the debugger to see what X looks like.  */
 
-void
+DEBUG_FUNCTION void
 debug_rtx (const_rtx x)
 {
   outfile = stderr;
@@ -638,7 +638,7 @@
 /* Count of rtx's to print with debug_rtx_list.
    This global exists because gdb user defined commands have no arguments.  */
 
-int debug_rtx_count = 0;	/* 0 is treated as equivalent to 1 */
+DEBUG_VARIABLE int debug_rtx_count = 0;	/* 0 is treated as equivalent to 1 */
 
 /* Call this function to print list from X on.
 
@@ -646,7 +646,7 @@
    rtx on.  Negative values print a window around the rtx.
    EG: -5 prints 2 rtx's on either side (in addition to the specified rtx).  */
 
-void
+DEBUG_FUNCTION void
 debug_rtx_list (const_rtx x, int n)
 {
   int i,count;
@@ -673,7 +673,7 @@
 
 /* Call this function to print an rtx list from START to END inclusive.  */
 
-void
+DEBUG_FUNCTION void
 debug_rtx_range (const_rtx start, const_rtx end)
 {
   while (1)
@@ -690,7 +690,7 @@
    and then call debug_rtx_list to print it, using DEBUG_RTX_COUNT.
    The found insn is returned to enable further debugging analysis.  */
 
-const_rtx
+DEBUG_FUNCTION const_rtx
 debug_rtx_find (const_rtx x, int uid)
 {
   while (x != 0 && INSN_UID (x) != uid)
Index: stor-layout.c
===================================================================
--- stor-layout.c	(revision 160033)
+++ stor-layout.c	(working copy)
@@ -813,7 +813,7 @@
 
 /* Print debugging information about the information in RLI.  */
 
-void
+DEBUG_FUNCTION void
 debug_rli (record_layout_info rli)
 {
   print_node_brief (stderr, "type", rli->t, 0);
Index: ipa.c
===================================================================
--- ipa.c	(revision 160033)
+++ ipa.c	(working copy)
@@ -1004,7 +1006,7 @@
 
 /* Dump content of SET to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_cgraph_node_set (cgraph_node_set set)
 {
   dump_cgraph_node_set (stderr, set);
@@ -1161,7 +1163,7 @@
 
 /* Dump content of SET to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_varpool_node_set (varpool_node_set set)
 {
   dump_varpool_node_set (stderr, set);
Index: tree-data-ref.c
===================================================================
--- tree-data-ref.c	(revision 160033)
+++ tree-data-ref.c	(working copy)
@@ -161,7 +161,7 @@
 
 /* Dump into STDERR all the data references from DATAREFS.  */
 
-void
+DEBUG_FUNCTION void
 debug_data_references (VEC (data_reference_p, heap) *datarefs)
 {
   dump_data_references (stderr, datarefs);
@@ -169,7 +169,7 @@
 
 /* Dump to STDERR all the dependence relations from DDRS.  */
 
-void
+DEBUG_FUNCTION void
 debug_data_dependence_relations (VEC (ddr_p, heap) *ddrs)
 {
   dump_data_dependence_relations (stderr, ddrs);
@@ -190,7 +190,7 @@
 
 /* Print to STDERR the data_reference DR.  */
 
-void
+DEBUG_FUNCTION void
 debug_data_reference (struct data_reference *dr)
 {
   dump_data_reference (stderr, dr);
@@ -364,7 +364,7 @@
 
 /* Debug version.  */
 
-void
+DEBUG_FUNCTION void
 debug_data_dependence_relation (struct data_dependence_relation *ddr)
 {
   dump_data_dependence_relation (stderr, ddr);
@@ -4606,7 +4606,7 @@
 
 /* Call dump_rdg_vertex on stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_rdg_vertex (struct graph *rdg, int i)
 {
   dump_rdg_vertex (stderr, rdg, i);
@@ -4635,7 +4635,7 @@
 
 /* Call dump_rdg_vertex on stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_rdg_component (struct graph *rdg, int c)
 {
   dump_rdg_component (stderr, rdg, c, NULL);
@@ -4661,7 +4661,7 @@
 
 /* Call dump_rdg on stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_rdg (struct graph *rdg)
 {
   dump_rdg (stderr, rdg);
Index: tree-affine.c
===================================================================
--- tree-affine.c	(revision 160033)
+++ tree-affine.c	(working copy)
@@ -818,7 +818,7 @@
 
 /* Prints the affine VAL to the standard error, used for debugging.  */
 
-void
+DEBUG_FUNCTION void
 debug_aff (aff_tree *val)
 {
   print_aff (stderr, val);
Index: tree-dfa.c
===================================================================
--- tree-dfa.c	(revision 160033)
+++ tree-dfa.c	(working copy)
@@ -232,7 +232,7 @@
 
 /* Dump the list of all the referenced variables to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_referenced_vars (void)
 {
   dump_referenced_vars (stderr);
@@ -305,7 +305,7 @@
 
 /* Dump variable VAR and its may-aliases to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_variable (tree var)
 {
   dump_variable (stderr, var);
@@ -392,7 +392,7 @@
 
 /* Dump DFA statistics on stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_dfa_stats (void)
 {
   dump_dfa_stats (stderr);
Index: except.c
===================================================================
--- except.c	(revision 160033)
+++ except.c	(working copy)
@@ -3307,7 +3307,7 @@
 
 /* Dump the EH tree for FN on stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_eh_tree (struct function *fn)
 {
   dump_eh_tree (stderr, fn);
@@ -3315,7 +3315,7 @@
 
 /* Verify invariants on EH datastructures.  */
 
-void
+DEBUG_FUNCTION void
 verify_eh_tree (struct function *fun)
 {
   eh_region r, outer;
Index: emit-rtl.c
===================================================================
--- emit-rtl.c	(revision 160033)
+++ emit-rtl.c	(working copy)
@@ -2537,7 +2537,7 @@
 /* Go through all the RTL insn bodies and check that there is no unexpected
    sharing in between the subexpressions.  */
 
-void
+DEBUG_FUNCTION void
 verify_rtl_sharing (void)
 {
   rtx p;
Index: tree-ssa-pre.c
===================================================================
--- tree-ssa-pre.c	(revision 160033)
+++ tree-ssa-pre.c	(working copy)
@@ -986,7 +986,7 @@
 void debug_pre_expr (pre_expr);
 
 /* Like print_pre_expr but always prints to stderr.  */
-void
+DEBUG_FUNCTION void
 debug_pre_expr (pre_expr e)
 {
   print_pre_expr (stderr, e);
@@ -1023,7 +1023,7 @@
 
 void debug_bitmap_set (bitmap_set_t);
 
-void
+DEBUG_FUNCTION void
 debug_bitmap_set (bitmap_set_t set)
 {
   print_bitmap_set (stderr, set, "debug", 0);
@@ -1044,7 +1044,7 @@
 }
 
 
-void
+DEBUG_FUNCTION void
 debug_value_expressions (unsigned int val)
 {
   print_value_expressions (stderr, val);
Index: tree-ssa-live.c
===================================================================
--- tree-ssa-live.c	(revision 160033)
+++ tree-ssa-live.c	(working copy)
@@ -632,7 +632,7 @@
 /* Dump the tree of lexical scopes starting at SCOPE to stderr.  FLAGS
    is as in print_generic_expr.  */
 
-void
+DEBUG_FUNCTION void
 debug_scope_block (tree scope, int flags)
 {
   dump_scope_block (stderr, 0, scope, flags);
@@ -652,7 +652,7 @@
 /* Dump the tree of lexical scopes of current_function_decl to stderr.
    FLAGS is as in print_generic_expr.  */
 
-void
+DEBUG_FUNCTION void
 debug_scope_blocks (int flags)
 {
   dump_scope_blocks (stderr, flags);
Index: sese.c
===================================================================
--- sese.c	(revision 160033)
+++ sese.c	(working copy)
@@ -69,7 +69,7 @@
 
 /* Print to stderr all the elements of MAP.  */
 
-void
+DEBUG_FUNCTION void
 debug_rename_map (htab_t map)
 {
   htab_traverse (map, debug_rename_map_1, NULL);
@@ -118,7 +118,7 @@
 
 /* Print to stderr all the elements of MAP.  */
 
-void
+DEBUG_FUNCTION void
 debug_ivtype_map (htab_t map)
 {
   htab_traverse (map, debug_ivtype_map_1, NULL);
Index: print-tree.c
===================================================================
--- print-tree.c	(revision 160033)
+++ print-tree.c	(working copy)
@@ -50,7 +50,7 @@
    Most nodes referred to by this one are printed recursively
    down to a depth of six.  */
 
-void
+DEBUG_FUNCTION void
 debug_tree (tree node)
 {
   table = XCNEWVEC (struct bucket *, HASH_SIZE);
@@ -64,7 +64,7 @@
    Most nodes referred to by this one are printed recursively
    down to a depth of six.  */
 
-void
+DEBUG_FUNCTION void
 debug_vec_tree (VEC(tree,gc) *vec)
 {
   table = XCNEWVEC (struct bucket *, HASH_SIZE);
Index: cfglayout.c
===================================================================
--- cfglayout.c	(revision 160033)
+++ cfglayout.c	(working copy)
@@ -990,7 +990,7 @@
    2. Count insns in chain, going both directions, and check if equal.
    3. Check that get_last_insn () returns the actual end of chain.  */
 
-void
+DEBUG_FUNCTION void
 verify_insn_chain (void)
 {
   rtx x, prevx, nextx;
Index: graphite-clast-to-gimple.c
===================================================================
--- graphite-clast-to-gimple.c	(revision 160033)
+++ graphite-clast-to-gimple.c	(working copy)
@@ -149,7 +149,7 @@
 
 /* Print to stderr all the elements of MAP.  */
 
-void
+DEBUG_FUNCTION void
 debug_clast_name_indexes (htab_t map)
 {
   htab_traverse (map, debug_clast_name_indexes_1, NULL);
@@ -1481,7 +1481,7 @@
 
 /* Prints STMT to STDERR.  */
 
-void
+DEBUG_FUNCTION void
 debug_clast_stmt (struct clast_stmt *stmt)
 {
   print_clast_stmt (stderr, stmt);
@@ -1530,7 +1530,7 @@
 
 /* Prints to STDERR the code generated by CLooG for SCOP.  */
 
-void
+DEBUG_FUNCTION void
 debug_generated_program (scop_p scop)
 {
   print_generated_program (stderr, scop);
Index: ggc-page.c
===================================================================
--- ggc-page.c	(revision 160033)
+++ ggc-page.c	(working copy)
@@ -645,7 +645,7 @@
 
 /* Prints the page-entry for object size ORDER, for debugging.  */
 
-void
+DEBUG_FUNCTION void
 debug_print_page_list (int order)
 {
   page_entry *p;
Index: tree-ssa-ter.c
===================================================================
--- tree-ssa-ter.c	(revision 160033)
+++ tree-ssa-ter.c	(working copy)
@@ -705,7 +705,7 @@
    exclusively to debug TER.  F is the place to send debug info and T is the
    table being debugged.  */
 
-void
+DEBUG_FUNCTION void
 debug_ter (FILE *f, temp_expr_table_p t)
 {
   unsigned x, y;
Index: graphite-dependences.c
===================================================================
--- graphite-dependences.c	(revision 160033)
+++ graphite-dependences.c	(working copy)
@@ -202,7 +202,7 @@
 
 /* Prints to STDERR the poly_ddr_p PDDR.  */
 
-void
+DEBUG_FUNCTION void
 debug_pddr (poly_ddr_p pddr)
 {
   print_pddr (stderr, pddr);
Index: sched-deps.c
===================================================================
--- sched-deps.c	(revision 160033)
+++ sched-deps.c	(working copy)
@@ -4077,7 +4077,7 @@
   fprintf (f, "}");
 }
 
-void
+DEBUG_FUNCTION void
 debug_ds (ds_t s)
 {
   dump_ds (stderr, s);
Index: tree-ssa.c
===================================================================
--- tree-ssa.c	(revision 160033)
+++ tree-ssa.c	(working copy)
@@ -857,7 +857,7 @@
 /* Verify common invariants in the SSA web.
    TODO: verify the variable annotations.  */
 
-void
+DEBUG_FUNCTION void
 verify_ssa (bool check_modified_stmt)
 {
   size_t i;
Index: graphite-poly.c
===================================================================
--- graphite-poly.c	(revision 160033)
+++ graphite-poly.c	(working copy)
@@ -242,7 +242,7 @@
 /* Prints to STDERR the scattering function of PBB, at some VERBOSITY
    level.  */
 
-void
+DEBUG_FUNCTION void
 debug_scattering_function (poly_bb_p pbb, int verbosity)
 {
   print_scattering_function (stderr, pbb, verbosity);
@@ -251,7 +251,7 @@
 /* Prints to STDERR the iteration domain of PBB, at some VERBOSITY
    level.  */
 
-void
+DEBUG_FUNCTION void
 debug_iteration_domain (poly_bb_p pbb, int verbosity)
 {
   print_iteration_domain (stderr, pbb, verbosity);
@@ -260,7 +260,7 @@
 /* Prints to STDERR the scattering functions of every PBB of SCOP, at
    some VERBOSITY level.  */
 
-void
+DEBUG_FUNCTION void
 debug_scattering_functions (scop_p scop, int verbosity)
 {
   print_scattering_functions (stderr, scop, verbosity);
@@ -269,7 +269,7 @@
 /* Prints to STDERR the iteration domains of every PBB of SCOP, at
    some VERBOSITY level.  */
 
-void
+DEBUG_FUNCTION void
 debug_iteration_domains (scop_p scop, int verbosity)
 {
   print_iteration_domains (stderr, scop, verbosity);
@@ -500,7 +500,7 @@
 /* Prints to STDERR the polyhedral data reference PDR, at some
    VERBOSITY level.  */
 
-void
+DEBUG_FUNCTION void
 debug_pdr (poly_dr_p pdr, int verbosity)
 {
   print_pdr (stderr, pdr, verbosity);
@@ -703,7 +703,7 @@
 
 /* Print to STDERR all the data references of PBB.  */
 
-void
+DEBUG_FUNCTION void
 debug_pdrs (poly_bb_p pbb, int verbosity)
 {
   print_pdrs (stderr, pbb, verbosity);
@@ -937,7 +937,7 @@
 
 /* Print to STDERR the domain of PBB, at some VERBOSITY level.  */
 
-void
+DEBUG_FUNCTION void
 debug_pbb_domain (poly_bb_p pbb, int verbosity)
 {
   print_pbb_domain (stderr, pbb, verbosity);
@@ -946,7 +946,7 @@
 /* Print to FILE the domain and scattering function of PBB, at some
    VERBOSITY level.  */
 
-void
+DEBUG_FUNCTION void
 debug_pbb (poly_bb_p pbb, int verbosity)
 {
   print_pbb (stderr, pbb, verbosity);
@@ -954,7 +954,7 @@
 
 /* Print to STDERR the context of SCOP, at some VERBOSITY level.  */
 
-void
+DEBUG_FUNCTION void
 debug_scop_context (scop_p scop, int verbosity)
 {
   print_scop_context (stderr, scop, verbosity);
@@ -962,7 +962,7 @@
 
 /* Print to STDERR the SCOP, at some VERBOSITY level.  */
 
-void
+DEBUG_FUNCTION void
 debug_scop (scop_p scop, int verbosity)
 {
   print_scop (stderr, scop, verbosity);
@@ -971,7 +971,7 @@
 /* Print to STDERR the SCOP under CLooG format, at some VERBOSITY
    level.  */
 
-void
+DEBUG_FUNCTION void
 debug_cloog (scop_p scop, int verbosity)
 {
   print_cloog (stderr, scop, verbosity);
@@ -980,7 +980,7 @@
 /* Print to STDERR the parameters of SCOP, at some VERBOSITY
    level.  */
 
-void
+DEBUG_FUNCTION void
 debug_scop_params (scop_p scop, int verbosity)
 {
   print_scop_params (stderr, scop, verbosity);
@@ -1226,7 +1226,7 @@
 
 /* Print LST to STDERR.  */
 
-void
+DEBUG_FUNCTION void
 debug_lst (lst_p lst)
 {
   print_lst (stderr, lst, 0);
Index: tree-inline.c
===================================================================
--- tree-inline.c	(revision 160033)
+++ tree-inline.c	(working copy)
@@ -4544,7 +4544,7 @@
     return NULL;
 }
 
-bool
+DEBUG_FUNCTION bool
 debug_find_tree (tree top, tree search)
 {
   return walk_tree_without_duplicates (&top, debug_find_tree_1, search) != 0;
Index: graphite-ppl.c
===================================================================
--- graphite-ppl.c	(revision 160033)
+++ graphite-ppl.c	(working copy)
@@ -580,7 +580,7 @@
 
 /* Print to STDERR the linear expression LE.  */
 
-void
+DEBUG_FUNCTION void
 debug_ppl_linear_expr (ppl_Linear_Expression_t le)
 {
   ppl_print_linear_expr (stderr, le);
@@ -618,7 +618,7 @@
 
 /* Print to STDERR the polyhedron PH under its PolyLib matrix form.  */
 
-void
+DEBUG_FUNCTION void
 debug_ppl_polyhedron_matrix (ppl_Polyhedron_t ph)
 {
   ppl_print_polyhedron_matrix (stderr, ph);
@@ -626,7 +626,7 @@
 
 /* Print to STDERR the powerset PS in its PolyLib matrix form.  */
 
-void
+DEBUG_FUNCTION void
 debug_ppl_powerset_matrix (ppl_Pointset_Powerset_C_Polyhedron_t ps)
 {
   ppl_print_powerset_matrix (stderr, ps);
Index: var-tracking.c
===================================================================
--- var-tracking.c	(revision 160033)
+++ var-tracking.c	(working copy)
@@ -1098,7 +1098,7 @@
 
 extern void debug_dv (decl_or_value dv);
 
-void
+DEBUG_FUNCTION void
 debug_dv (decl_or_value dv)
 {
   if (dv_is_value_p (dv))
Index: system.h
===================================================================
--- system.h	(revision 160033)
+++ system.h	(working copy)
@@ -873,4 +873,14 @@
 #define VALGRIND_FREELIKE_BLOCK(x,y)
 #endif
 
+/* In LTO -fwhole-program build we still want to keep the debug functions available
+   for debugger.  Mark them as used to prevent removal.  */
+#if (GCC_VERSION > 4000)
+#define DEBUG_FUNCTION __attribute__ ((__used__))
+#define DEBUG_VARIABLE __attribute__ ((__used__))
+#else
+#define DEBUG_FUNCTION
+#define DEBUG_VARIABLE
+#endif
+
 #endif /* ! GCC_SYSTEM_H */
Index: cfgloop.c
===================================================================
--- cfgloop.c	(revision 160033)
+++ cfgloop.c	(working copy)
@@ -1316,7 +1316,7 @@
      -- loop latches have only single successor that is header of their loop
      -- irreducible loops are correctly marked
   */
-void
+DEBUG_FUNCTION void
 verify_loop_structure (void)
 {
   unsigned *sizes, i, j;
Index: plugin.c
===================================================================
--- plugin.c	(revision 160033)
+++ plugin.c	(working copy)
@@ -778,7 +778,7 @@
 /* Dump to FILE the names and associated events for all the active
    plugins.  */
 
-void
+DEBUG_FUNCTION void
 dump_active_plugins (FILE *file)
 {
   int event;
@@ -804,7 +804,7 @@
 
 /* Dump active plugins to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_active_plugins (void)
 {
   dump_active_plugins (stderr);
Index: c-common.c
===================================================================
--- c-common.c	(revision 160033)
+++ c-common.c	(working copy)
@@ -2705,7 +2705,7 @@
 /* Try to warn for undefined behavior in EXPR due to missing sequence
    points.  */
 
-void
+DEBUG_FUNCTION void
 verify_sequence_points (tree expr)
 {
   struct tlist *before_sp = 0, *after_sp = 0;
Index: sched-rgn.c
===================================================================
--- sched-rgn.c	(revision 160033)
+++ sched-rgn.c	(working copy)
@@ -354,7 +354,7 @@
 
 /* Print the regions, for debugging purposes.  Callable from debugger.  */
 
-void
+DEBUG_FUNCTION void
 debug_regions (void)
 {
   int rgn, bb;
@@ -379,7 +379,7 @@
 
 /* Print the region's basic blocks.  */
 
-void
+DEBUG_FUNCTION void
 debug_region (int rgn)
 {
   int bb;
@@ -1594,7 +1594,7 @@
 
 /* Print candidates info, for debugging purposes.  Callable from debugger.  */
 
-void
+DEBUG_FUNCTION void
 debug_candidate (int i)
 {
   if (!candidate_table[i].is_valid)
@@ -1631,7 +1631,7 @@
 
 /* Print candidates info, for debugging purposes.  Callable from debugger.  */
 
-void
+DEBUG_FUNCTION void
 debug_candidates (int trg)
 {
   int i;
@@ -2775,7 +2775,7 @@
    Callable from debugger.  */
 /* Print dependences for debugging starting from FROM_BB.
    Callable from debugger.  */
-void
+DEBUG_FUNCTION void
 debug_rgn_dependencies (int from_bb)
 {
   int bb;
Index: tree-ssa-structalias.c
===================================================================
--- tree-ssa-structalias.c	(revision 160033)
+++ tree-ssa-structalias.c	(working copy)
@@ -716,7 +716,7 @@
 
 /* Print out constraint C to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_constraint (constraint_t c)
 {
   dump_constraint (stderr, c);
@@ -735,7 +735,7 @@
 
 /* Print out all constraints to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_constraints (void)
 {
   dump_constraints (stderr, 0);
@@ -825,7 +825,7 @@
 
 /* Print out the constraint graph to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_constraint_graph (void)
 {
   dump_constraint_graph (stderr);
@@ -5434,7 +5434,7 @@
 
 /* Print the points-to solution for VAR to stdout.  */
 
-void
+DEBUG_FUNCTION void
 debug_solution_for_var (unsigned int var)
 {
   dump_solution_for_var (stdout, var);
@@ -6035,7 +6035,7 @@
 
 /* Debug points-to information to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_sa_points_to_info (void)
 {
   dump_sa_points_to_info (stderr);
Index: sched-vis.c
===================================================================
--- sched-vis.c	(revision 160033)
+++ sched-vis.c	(working copy)
@@ -763,7 +763,7 @@
 }
 
 /* Emit a slim dump of X (an insn) to stderr.  */
-void
+DEBUG_FUNCTION void
 debug_insn_slim (rtx x)
 {
   dump_insn_slim (stderr, x);
@@ -814,13 +814,13 @@
     }
 }
 
-void
+DEBUG_FUNCTION void
 debug_bb_slim (struct basic_block_def *bb)
 {
   print_rtl_slim (stderr, BB_HEAD (bb), BB_END (bb), -1, 32);
 }
 
-void
+DEBUG_FUNCTION void
 debug_bb_n_slim (int n)
 {
   struct basic_block_def *bb = BASIC_BLOCK (n);
Index: tree-cfg.c
===================================================================
--- tree-cfg.c	(revision 160033)
+++ tree-cfg.c	(working copy)
@@ -2110,7 +2110,7 @@
 /* Dump CFG statistics on stderr.  Keep extern so that it's always
    linked in the final executable.  */
 
-void
+DEBUG_FUNCTION void
 debug_cfg_stats (void)
 {
   dump_cfg_stats (stderr);
@@ -4074,7 +4074,7 @@
 
 /* Verify the GIMPLE statements in every basic block.  */
 
-void
+DEBUG_FUNCTION void
 verify_stmts (void)
 {
   basic_block bb;
@@ -6314,7 +6314,7 @@
 
 /* Dump FUNCTION_DECL FN to stderr using FLAGS (see TDF_* in tree.h)  */
 
-void
+DEBUG_FUNCTION void
 debug_function (tree fn, int flags)
 {
   dump_function_to_file (fn, stderr, flags);
@@ -6455,7 +6455,7 @@
 
 /* Debugging loops structure at tree level, at some VERBOSITY level.  */
 
-void
+DEBUG_FUNCTION void
 debug_loops (int verbosity)
 {
   print_loops (stderr, verbosity);
@@ -6463,7 +6463,7 @@
 
 /* Print on stderr the code of LOOP, at some VERBOSITY level.  */
 
-void
+DEBUG_FUNCTION void
 debug_loop (struct loop *loop, int verbosity)
 {
   print_loop (stderr, loop, 0, verbosity);
@@ -6472,7 +6472,7 @@
 /* Print on stderr the code of loop number NUM, at some VERBOSITY
    level.  */
 
-void
+DEBUG_FUNCTION void
 debug_loop_num (unsigned num, int verbosity)
 {
   debug_loop (get_loop (num), verbosity);
Index: passes.c
===================================================================
--- passes.c	(revision 160033)
+++ passes.c	(working copy)
@@ -121,7 +121,7 @@
 
 
 /* Call from the debugger to get the current pass name.  */
-void
+DEBUG_FUNCTION void
 debug_pass (void)
 {
   print_current_pass (stderr);
@@ -1988,7 +1988,7 @@
 extern void debug_properties (unsigned int);
 extern void dump_properties (FILE *, unsigned int);
 
-void
+DEBUG_FUNCTION void
 dump_properties (FILE *dump, unsigned int props)
 {
   fprintf (dump, "Properties:\n");
@@ -2012,9 +2012,11 @@
     fprintf (dump, "PROP_gimple_lomp\n");
   if (props & PROP_gimple_lcx)
     fprintf (dump, "PROP_gimple_lcx\n");
+  if (props & PROP_cfglayout)
+    fprintf (dump, "PROP_cfglayout\n");
 }
 
-void
+DEBUG_FUNCTION void
 debug_properties (unsigned int props)
 {
   dump_properties (stderr, props);
Index: tree-ssa-reassoc.c
===================================================================
--- tree-ssa-reassoc.c	(revision 160033)
+++ tree-ssa-reassoc.c	(working copy)
@@ -2147,7 +2147,7 @@
 
 /* Dump the operand entry vector OPS to STDERR.  */
 
-void
+DEBUG_FUNCTION void
 debug_ops_vector (VEC (operand_entry_t, heap) *ops)
 {
   dump_ops_vector (stderr, ops);
Index: varpool.c
===================================================================
--- varpool.c	(revision 160033)
+++ varpool.c	(working copy)
@@ -263,7 +263,7 @@
 
 /* Dump the variable pool to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_varpool (void)
 {
   dump_varpool (stderr);
Index: regcprop.c
===================================================================
--- regcprop.c	(revision 160033)
+++ regcprop.c	(working copy)
@@ -1057,7 +1057,7 @@
 
 /* Dump the value chain data to stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_value_data (struct value_data *vd)
 {
   HARD_REG_SET set;
Index: tree-ssa-operands.c
===================================================================
--- tree-ssa-operands.c	(revision 160033)
+++ tree-ssa-operands.c	(working copy)
@@ -1180,7 +1180,7 @@
 /* Scan the immediate_use list for VAR making sure its linked properly.
    Return TRUE if there is a problem and emit an error message to F.  */
 
-bool
+DEBUG_FUNCTION bool
 verify_imm_links (FILE *f, tree var)
 {
   use_operand_p ptr, prev, list;
@@ -1304,7 +1304,7 @@
 
 /* Dump def-use edges on stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_immediate_uses (void)
 {
   dump_immediate_uses (stderr);
@@ -1313,7 +1313,7 @@
 
 /* Dump def-use edges on stderr.  */
 
-void
+DEBUG_FUNCTION void
 debug_immediate_uses_for (tree var)
 {
   dump_immediate_uses_for (stderr, var);



More information about the Gcc-patches mailing list