diff options
author | Martin Jambor <mjambor@suse.cz> | 2011-04-11 17:17:44 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2011-04-11 17:17:44 +0200 |
commit | 9f9ebcdfc635e94463350898b625e0f3b1431ec0 (patch) | |
tree | 2c3c04107c858150dae9c1fa382093e2fa6bd141 /gcc/gimplify.c | |
parent | 581985d71026fb5cf52fef156b76a619ce07e88c (diff) | |
download | gcc-9f9ebcdfc635e94463350898b625e0f3b1431ec0.zip gcc-9f9ebcdfc635e94463350898b625e0f3b1431ec0.tar.gz gcc-9f9ebcdfc635e94463350898b625e0f3b1431ec0.tar.bz2 |
cgraph.c (cgraph_local_info): Call cgraph_get_node instead of cgraph_node, handle NULL return value.
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.
From-SVN: r172258
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 633e613..598fe9c 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -959,11 +959,11 @@ copy_if_shared (tree *tp) static void unshare_body (tree *body_p, tree fndecl) { - struct cgraph_node *cgn = cgraph_node (fndecl); + struct cgraph_node *cgn = cgraph_get_node (fndecl); copy_if_shared (body_p); - if (body_p == &DECL_SAVED_TREE (fndecl)) + if (cgn && body_p == &DECL_SAVED_TREE (fndecl)) for (cgn = cgn->nested; cgn; cgn = cgn->next_nested) unshare_body (&DECL_SAVED_TREE (cgn->decl), cgn->decl); } @@ -1000,11 +1000,11 @@ unmark_visited (tree *tp) static void unvisit_body (tree *body_p, tree fndecl) { - struct cgraph_node *cgn = cgraph_node (fndecl); + struct cgraph_node *cgn = cgraph_get_node (fndecl); unmark_visited (body_p); - if (body_p == &DECL_SAVED_TREE (fndecl)) + if (cgn && body_p == &DECL_SAVED_TREE (fndecl)) for (cgn = cgn->nested; cgn; cgn = cgn->next_nested) unvisit_body (&DECL_SAVED_TREE (cgn->decl), cgn->decl); } @@ -7695,6 +7695,7 @@ gimplify_body (tree *body_p, tree fndecl, bool do_parms) gimple_seq parm_stmts, seq; gimple outer_bind; struct gimplify_ctx gctx; + struct cgraph_node *cgn; timevar_push (TV_TREE_GIMPLIFY); @@ -7712,7 +7713,8 @@ gimplify_body (tree *body_p, tree fndecl, bool do_parms) unshare_body (body_p, fndecl); unvisit_body (body_p, fndecl); - if (cgraph_node (fndecl)->origin) + cgn = cgraph_get_node (fndecl); + if (cgn && cgn->origin) nonlocal_vlas = pointer_set_create (); /* Make sure input_location isn't set to something weird. */ |