diff options
Diffstat (limited to 'gcc/predict.c')
-rw-r--r-- | gcc/predict.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/predict.c b/gcc/predict.c index 1b61ee4..eb91b87 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -2187,6 +2187,11 @@ compute_function_frequency (void) { basic_block bb; struct cgraph_node *node = cgraph_node (current_function_decl); + if (DECL_STATIC_CONSTRUCTOR (current_function_decl) + || MAIN_NAME_P (DECL_NAME (current_function_decl))) + node->only_called_at_startup = true; + if (DECL_STATIC_DESTRUCTOR (current_function_decl)) + node->only_called_at_exit = true; if (!profile_info || !flag_branch_probabilities) { |