summaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-11 15:17:44 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-11 15:17:44 +0000
commit924de0917e85c5c476526369673a56b4a1ba437b (patch)
tree2c3c04107c858150dae9c1fa382093e2fa6bd141 /gcc/varasm.c
parentfd6a3c418624eaa7363466e28b2a3b6532929e4b (diff)
downloadgcc-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/varasm.c')
-rw-r--r--gcc/varasm.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 332f0f46033..8365612e5f3 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -573,11 +573,14 @@ function_section_1 (tree decl, bool force_cold)
if (decl)
{
- struct cgraph_node *node = cgraph_node (decl);
+ struct cgraph_node *node = cgraph_get_node (decl);
- freq = node->frequency;
- startup = node->only_called_at_startup;
- exit = node->only_called_at_exit;
+ if (node)
+ {
+ freq = node->frequency;
+ startup = node->only_called_at_startup;
+ exit = node->only_called_at_exit;
+ }
}
if (force_cold)
freq = NODE_FREQUENCY_UNLIKELY_EXECUTED;
@@ -1575,11 +1578,12 @@ assemble_start_function (tree decl, const char *fnname)
}
else if (DECL_SECTION_NAME (decl))
{
+ struct cgraph_node *node = cgraph_get_node (current_function_decl);
/* Calls to function_section rely on first_function_block_is_cold
being accurate. */
- first_function_block_is_cold
- = (cgraph_node (current_function_decl)->frequency
- == NODE_FREQUENCY_UNLIKELY_EXECUTED);
+ first_function_block_is_cold = (node
+ && node->frequency
+ == NODE_FREQUENCY_UNLIKELY_EXECUTED);
}
in_cold_section_p = first_function_block_is_cold;