summaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-out.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/lto-streamer-out.c')
-rw-r--r--gcc/lto-streamer-out.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 11daf7a9d7f..d54beca6623 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -607,17 +607,12 @@ DFS::DFS (struct output_block *ob, tree expr, bool ref_p, bool this_ref_p,
std::swap (sccstack[first + i],
sccstack[first + entry_start + i]);
- if (scc_entry_len == 1)
- ; /* We already sorted SCC deterministically in hash_scc. */
- else
- /* Check that we have only one SCC.
- Naturally we may have conflicts if hash function is not
- strong enough. Lets see how far this gets. */
- {
-#ifdef ENABLE_CHECKING
- gcc_unreachable ();
-#endif
- }
+ /* We already sorted SCC deterministically in hash_scc. */
+
+ /* Check that we have only one SCC.
+ Naturally we may have conflicts if hash function is not
+ strong enough. Lets see how far this gets. */
+ gcc_checking_assert (scc_entry_len == 1);
}
/* Write LTO_tree_scc. */
@@ -2277,12 +2272,13 @@ void
lto_output (void)
{
struct lto_out_decl_state *decl_state;
-#ifdef ENABLE_CHECKING
- bitmap output = lto_bitmap_alloc ();
-#endif
+ bitmap output = NULL;
int i, n_nodes;
lto_symtab_encoder_t encoder = lto_get_out_decl_state ()->symtab_node_encoder;
+ if (flag_checking)
+ output = lto_bitmap_alloc ();
+
/* Initialize the streamer. */
lto_streamer_init ();
@@ -2296,10 +2292,11 @@ lto_output (void)
if (lto_symtab_encoder_encode_body_p (encoder, node)
&& !node->alias)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (!bitmap_bit_p (output, DECL_UID (node->decl)));
- bitmap_set_bit (output, DECL_UID (node->decl));
-#endif
+ if (flag_checking)
+ {
+ gcc_assert (!bitmap_bit_p (output, DECL_UID (node->decl)));
+ bitmap_set_bit (output, DECL_UID (node->decl));
+ }
decl_state = lto_new_out_decl_state ();
lto_push_out_decl_state (decl_state);
if (gimple_has_body_p (node->decl) || !flag_wpa
@@ -2326,10 +2323,11 @@ lto_output (void)
&& !node->alias)
{
timevar_push (TV_IPA_LTO_CTORS_OUT);
-#ifdef ENABLE_CHECKING
- gcc_assert (!bitmap_bit_p (output, DECL_UID (node->decl)));
- bitmap_set_bit (output, DECL_UID (node->decl));
-#endif
+ if (flag_checking)
+ {
+ gcc_assert (!bitmap_bit_p (output, DECL_UID (node->decl)));
+ bitmap_set_bit (output, DECL_UID (node->decl));
+ }
decl_state = lto_new_out_decl_state ();
lto_push_out_decl_state (decl_state);
if (DECL_INITIAL (node->decl) != error_mark_node
@@ -2353,7 +2351,7 @@ lto_output (void)
output_offload_tables ();
-#ifdef ENABLE_CHECKING
+#if CHECKING_P
lto_bitmap_free (output);
#endif
}