From 9f9ebcdfc635e94463350898b625e0f3b1431ec0 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Mon, 11 Apr 2011 17:17:44 +0200 Subject: cgraph.c (cgraph_local_info): Call cgraph_get_node instead of cgraph_node, handle NULL return value. 2011-04-11 Martin Jambor 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. From-SVN: r172258 --- gcc/cgraph.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'gcc/cgraph.c') diff --git a/gcc/cgraph.c b/gcc/cgraph.c index a6217e9..80f7c7c 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -1766,7 +1766,9 @@ cgraph_local_info (tree decl) struct cgraph_node *node; gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); - node = cgraph_node (decl); + node = cgraph_get_node (decl); + if (!node) + return NULL; return &node->local; } @@ -1778,7 +1780,9 @@ cgraph_global_info (tree decl) struct cgraph_node *node; gcc_assert (TREE_CODE (decl) == FUNCTION_DECL && cgraph_global_info_ready); - node = cgraph_node (decl); + node = cgraph_get_node (decl); + if (!node) + return NULL; return &node->global; } @@ -1790,9 +1794,10 @@ cgraph_rtl_info (tree decl) struct cgraph_node *node; gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); - node = cgraph_node (decl); - if (decl != current_function_decl - && !TREE_ASM_WRITTEN (node->decl)) + node = cgraph_get_node (decl); + if (!node + || (decl != current_function_decl + && !TREE_ASM_WRITTEN (node->decl))) return NULL; return &node->rtl; } -- cgit v1.1