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/tree-ssa-alias.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/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index f7fc7d2..4edacb5 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -1245,14 +1245,18 @@ ref_maybe_used_by_call_p_1 (gimple call, ao_ref *ref) /* Check if base is a global static variable that is not read by the function. */ - if (TREE_CODE (base) == VAR_DECL + if (callee != NULL_TREE + && TREE_CODE (base) == VAR_DECL && TREE_STATIC (base)) { + struct cgraph_node *node = cgraph_get_node (callee); bitmap not_read; - if (callee != NULL_TREE - && (not_read - = ipa_reference_get_not_read_global (cgraph_node (callee))) + /* FIXME: Callee can be an OMP builtin that does not have a call graph + node yet. We should enforce that there are nodes for all decls in the + IL and remove this check instead. */ + if (node + && (not_read = ipa_reference_get_not_read_global (node)) && bitmap_bit_p (not_read, DECL_UID (base))) goto process_args; } @@ -1512,10 +1516,11 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref) && TREE_CODE (base) == VAR_DECL && TREE_STATIC (base)) { + struct cgraph_node *node = cgraph_get_node (callee); bitmap not_written; - if ((not_written - = ipa_reference_get_not_written_global (cgraph_node (callee))) + if (node + && (not_written = ipa_reference_get_not_written_global (node)) && bitmap_bit_p (not_written, DECL_UID (base))) return false; } |