summaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c39
1 files changed, 14 insertions, 25 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 0b0c0f4b6f4..eab8c7f28aa 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1325,13 +1325,12 @@ handle_alias_pairs (void)
static void
mark_functions_to_output (void)
{
- cgraph_node *node;
-#ifdef ENABLE_CHECKING
bool check_same_comdat_groups = false;
+ cgraph_node *node;
- FOR_EACH_FUNCTION (node)
- gcc_assert (!node->process);
-#endif
+ if (flag_checking)
+ FOR_EACH_FUNCTION (node)
+ gcc_assert (!node->process);
FOR_EACH_FUNCTION (node)
{
@@ -1365,15 +1364,14 @@ mark_functions_to_output (void)
}
else if (node->same_comdat_group)
{
-#ifdef ENABLE_CHECKING
- check_same_comdat_groups = true;
-#endif
+ if (flag_checking)
+ check_same_comdat_groups = true;
}
else
{
/* We should've reclaimed all functions that are not needed. */
-#ifdef ENABLE_CHECKING
- if (!node->global.inlined_to
+ if (flag_checking
+ && !node->global.inlined_to
&& gimple_has_body_p (decl)
/* FIXME: in ltrans unit when offline copy is outside partition but inline copies
are inside partition, we can end up not removing the body since we no longer
@@ -1386,7 +1384,6 @@ mark_functions_to_output (void)
node->debug ();
internal_error ("failed to reclaim unneeded function");
}
-#endif
gcc_assert (node->global.inlined_to
|| !gimple_has_body_p (decl)
|| node->in_other_partition
@@ -1397,8 +1394,7 @@ mark_functions_to_output (void)
}
}
-#ifdef ENABLE_CHECKING
- if (check_same_comdat_groups)
+ if (flag_checking && check_same_comdat_groups)
FOR_EACH_FUNCTION (node)
if (node->same_comdat_group && !node->process)
{
@@ -1418,7 +1414,6 @@ mark_functions_to_output (void)
"comdat group");
}
}
-#endif
}
/* DECL is FUNCTION_DECL. Initialize datastructures so DECL is a function
@@ -1887,9 +1882,7 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
TREE_ASM_WRITTEN (thunk_fndecl) = false;
delete_unreachable_blocks ();
update_ssa (TODO_update_ssa);
-#ifdef ENABLE_CHECKING
- verify_flow_info ();
-#endif
+ checking_verify_flow_info ();
free_dominance_info (CDI_DOMINATORS);
/* Since we want to emit the thunk, we explicitly mark its name as
@@ -2373,9 +2366,7 @@ symbol_table::compile (void)
if (seen_error ())
return;
-#ifdef ENABLE_CHECKING
- symtab_node::verify_symtab_nodes ();
-#endif
+ symtab_node::checking_verify_symtab_nodes ();
timevar_push (TV_CGRAPHOPT);
if (pre_ipa_mem_report)
@@ -2424,9 +2415,7 @@ symbol_table::compile (void)
(*debug_hooks->assembly_start) ();
if (!quiet_flag)
fprintf (stderr, "Assembling functions:\n");
-#ifdef ENABLE_CHECKING
- symtab_node::verify_symtab_nodes ();
-#endif
+ symtab_node::checking_verify_symtab_nodes ();
materialize_all_clones ();
bitmap_obstack_initialize (NULL);
@@ -2482,7 +2471,8 @@ symbol_table::compile (void)
fprintf (dump_file, "\nFinal ");
symtab_node::dump_table (dump_file);
}
-#ifdef ENABLE_CHECKING
+ if (!flag_checking)
+ return;
symtab_node::verify_symtab_nodes ();
/* Double check that all inline clones are gone and that all
function bodies have been released from memory. */
@@ -2501,7 +2491,6 @@ symbol_table::compile (void)
if (error_found)
internal_error ("nodes with unreleased memory found");
}
-#endif
}