diff options
author | Martin Jambor <mjambor@suse.cz> | 2011-04-11 15:17:44 +0000 |
---|---|---|
committer | Martin Jambor <mjambor@suse.cz> | 2011-04-11 15:17:44 +0000 |
commit | f4504e4f9c14de613f6de36b94e526e3a3e1a8c4 (patch) | |
tree | 2c3c04107c858150dae9c1fa382093e2fa6bd141 /gcc/tree-ssa-alias.c | |
parent | 0dfaa072c71d7c410ba428d7368dc0a360d820d8 (diff) |
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: https://gcc.gnu.org/svn/gcc/trunk@172258 138bc75d-0d04-0410-961f-82ee72b054a4
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 f7fc7d20881..4edacb56ba6 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; } |