diff options
author | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-11 15:17:44 +0000 |
---|---|---|
committer | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-04-11 15:17:44 +0000 |
commit | 924de0917e85c5c476526369673a56b4a1ba437b (patch) | |
tree | 2c3c04107c858150dae9c1fa382093e2fa6bd141 /gcc/predict.c | |
parent | fd6a3c418624eaa7363466e28b2a3b6532929e4b (diff) | |
download | gcc-924de0917e85c5c476526369673a56b4a1ba437b.tar.gz |
2011-04-11 Martin Jambor <mjambor@suse.cz>
gcc/
* cgraph.c (cgraph_local_info): Call cgraph_get_node instead
of cgraph_node, handle NULL return value.
(cgraph_global_info): Likewise.
(cgraph_rtl_info): Likewise.
* tree-inline.c (estimate_num_insns): Likewise.
* gimplify.c (unshare_body): Likewise.
(unvisit_body): Likewise.
(gimplify_body): Likewise.
* predict.c (optimize_function_for_size_p): Likewise.
* tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise.
(call_may_clobber_ref_p_1): Likewise.
* varasm.c (function_section_1): Likewise.
(assemble_start_function): Likewise.
gcc/java/
* decl.c (java_mark_decl_local): Call cgraph_get_node instead of
cgraph_node and handle returned NULL.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172258 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/predict.c')
-rw-r--r-- | gcc/predict.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/predict.c b/gcc/predict.c index b9a4063073b..f210428fca1 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -214,10 +214,17 @@ probably_never_executed_bb_p (const_basic_block bb) bool optimize_function_for_size_p (struct function *fun) { - return (optimize_size - || (fun && fun->decl - && (cgraph_node (fun->decl)->frequency - == NODE_FREQUENCY_UNLIKELY_EXECUTED))); + struct cgraph_node *node; + + if (optimize_size) + return true; + if (!fun || !fun->decl) + return false; + node = cgraph_get_node (fun->decl); + if (node && (node->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED)) + return true; + else + return false; } /* Return true when current function should always be optimized for speed. */ |