aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.6/gcc/tree-profile.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.6/gcc/tree-profile.c')
-rw-r--r--gcc-4.6/gcc/tree-profile.c45
1 files changed, 28 insertions, 17 deletions
diff --git a/gcc-4.6/gcc/tree-profile.c b/gcc-4.6/gcc/tree-profile.c
index 13aad30..352b8ef 100644
--- a/gcc-4.6/gcc/tree-profile.c
+++ b/gcc-4.6/gcc/tree-profile.c
@@ -163,10 +163,10 @@ init_ic_make_global_vars (void)
static struct pointer_set_t *instrumentation_to_be_sampled = NULL;
/* extern __thread gcov_unsigned_t __gcov_sample_counter */
-static tree gcov_sample_counter_decl = NULL_TREE;
+static GTY(()) tree gcov_sample_counter_decl = NULL_TREE;
/* extern gcov_unsigned_t __gcov_sampling_rate */
-static tree gcov_sampling_rate_decl = NULL_TREE;
+static GTY(()) tree gcov_sampling_rate_decl = NULL_TREE;
/* forward declaration. */
void gimple_init_instrumentation_sampling (void);
@@ -281,9 +281,13 @@ add_sampling_to_edge_counters (void)
break;
}
}
+}
+static void
+cleanup_instrumentation_sampling (void)
+{
/* Free the bitmap. */
- if (instrumentation_to_be_sampled)
+ if (flag_profile_generate_sampling && instrumentation_to_be_sampled)
{
pointer_set_destroy (instrumentation_to_be_sampled);
instrumentation_to_be_sampled = NULL;
@@ -1095,13 +1099,16 @@ gimple_gen_reusedist (void)
reusedist_make_instr_call (stmt, subst, counters),
GSI_NEW_STMT);
- locus = (stmt != NULL)
- ? gimple_location (stmt)
- : DECL_SOURCE_LOCATION (current_function_decl);
- inform (locus,
- "inserted reuse distance instrumentation for %qs, using "
- "%d gcov counters", subst->original_name,
- subst->num_ptr_args * RD_NUM_COUNTERS);
+ if (flag_opt_info >= OPT_INFO_MAX)
+ {
+ locus = (stmt != NULL)
+ ? gimple_location (stmt)
+ : DECL_SOURCE_LOCATION (current_function_decl);
+ inform (locus,
+ "inserted reuse distance instrumentation for %qs, using "
+ "%d gcov counters", subst->original_name,
+ subst->num_ptr_args * RD_NUM_COUNTERS);
+ }
}
}
}
@@ -1213,7 +1220,7 @@ maybe_issue_profile_use_note (location_t locus, gcov_type* counters, int arg)
reusedist_from_counters (counters, &rd);
- if (rd.count)
+ if ((flag_opt_info >= OPT_INFO_MAX) && rd.count)
inform (locus, "reuse distance counters for arg %d: %lld %lld %lld %lld",
arg, (long long int)rd.mean_dist, (long long int)rd.mean_size,
(long long int)rd.count, (long long int)rd.dist_x_size);
@@ -1282,9 +1289,10 @@ reusedist_maybe_replace_with_nt_version (gimple stmt,
subst_decl = reusedist_get_nt_decl (gimple_call_fndecl (stmt), subst,
suffix);
gimple_call_set_fndecl (stmt, subst_decl);
- inform (locus, "replaced %qs with non-temporal %qs",
- subst->original_name,
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (subst_decl)));
+ if (flag_opt_info >= OPT_INFO_MED)
+ inform (locus, "replaced %qs with non-temporal %qs",
+ subst->original_name,
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (subst_decl)));
}
/* Replace string operations with equivalent nontemporal, when profitable. */
@@ -1322,11 +1330,13 @@ optimize_reusedist (void)
if (counter_index != n_counters)
{
- warning (0, "coverage mismatch for reuse distance counters "
+ warning (OPT_Wcoverage_mismatch,
+ "coverage mismatch for reuse distance counters "
"in function %qs", IDENTIFIER_POINTER
(DECL_ASSEMBLER_NAME (current_function_decl)));
- inform (input_location, "number of counters is %u instead of %u",
- n_counters, counter_index);
+ if (flag_opt_info >= OPT_INFO_MAX)
+ inform (input_location, "number of counters is %u instead of %u",
+ n_counters, counter_index);
}
}
@@ -1452,6 +1462,7 @@ tree_profiling (void)
}
del_node_map();
+ cleanup_instrumentation_sampling();
return 0;
}