aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-reference.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2011-06-10 12:15:30 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2011-06-10 10:15:30 +0000
commitfede8efad0bfa82997fd1ff49f84eb493231ca23 (patch)
tree48d43b22dfa25b1fd6a1b3335c96ecedb737ae09 /gcc/ipa-reference.c
parent0127c76f613c84e31efdc6b1c6d1634718b8f691 (diff)
downloadgcc-fede8efad0bfa82997fd1ff49f84eb493231ca23.zip
gcc-fede8efad0bfa82997fd1ff49f84eb493231ca23.tar.gz
gcc-fede8efad0bfa82997fd1ff49f84eb493231ca23.tar.bz2
ipa-utils.c (searchc): Use cgraph_function_or_thunk_node.
* ipa-utils.c (searchc): Use cgraph_function_or_thunk_node. * ipa-pure-const.c (analyze_function): Aliases don't need analysis. (self_recursive_p): Use cgraph_function_node. (propagate_pure_const): Likewise. (propagate_nothrow): Likewise. * ipa-reference.c (ipa_reference_get_not_read_global): Use cgraph_function_node. (propagate_bits): Likewise. (propagate): Likewise. From-SVN: r174895
Diffstat (limited to 'gcc/ipa-reference.c')
-rw-r--r--gcc/ipa-reference.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c
index b14d636..7ee52da 100644
--- a/gcc/ipa-reference.c
+++ b/gcc/ipa-reference.c
@@ -196,7 +196,7 @@ ipa_reference_get_not_read_global (struct cgraph_node *fn)
{
ipa_reference_optimization_summary_t info;
- info = get_reference_optimization_summary (fn);
+ info = get_reference_optimization_summary (cgraph_function_node (fn, NULL));
if (info)
return info->statics_not_read;
else if (flags_from_decl_or_type (fn->decl) & ECF_LEAF)
@@ -301,16 +301,17 @@ propagate_bits (ipa_reference_global_vars_info_t x_global, struct cgraph_node *x
struct cgraph_edge *e;
for (e = x->callees; e; e = e->next_callee)
{
- struct cgraph_node *y = e->callee;
enum availability avail;
+ struct cgraph_node *y = cgraph_function_node (e->callee, &avail);
- avail = cgraph_function_body_availability (e->callee);
+ if (!y)
+ continue;
/* Only look into nodes we can propagate something. */
if (avail > AVAIL_OVERWRITABLE
|| (avail == AVAIL_OVERWRITABLE
- && (flags_from_decl_or_type (e->callee->decl) & ECF_LEAF)))
+ && (flags_from_decl_or_type (y->decl) & ECF_LEAF)))
{
- int flags = flags_from_decl_or_type (e->callee->decl);
+ int flags = flags_from_decl_or_type (y->decl);
if (get_reference_vars_info (y))
{
ipa_reference_vars_info_t y_info
@@ -663,8 +664,12 @@ propagate (void)
read_write_all_from_decl (node, &read_all, &write_all);
for (e = node->callees; e; e = e->next_callee)
- if (cgraph_function_body_availability (e->callee) <= AVAIL_OVERWRITABLE)
- read_write_all_from_decl (e->callee, &read_all, &write_all);
+ {
+ enum availability avail;
+ struct cgraph_node *callee = cgraph_function_node (e->callee, &avail);
+ if (!callee || avail <= AVAIL_OVERWRITABLE)
+ read_write_all_from_decl (callee, &read_all, &write_all);
+ }
for (ie = node->indirect_calls; ie; ie = ie->next_callee)
if (!(ie->indirect_info->ecf_flags & ECF_CONST))
@@ -696,8 +701,13 @@ propagate (void)
read_write_all_from_decl (w, &read_all, &write_all);
for (e = w->callees; e; e = e->next_callee)
- if (cgraph_function_body_availability (e->callee) <= AVAIL_OVERWRITABLE)
- read_write_all_from_decl (e->callee, &read_all, &write_all);
+ {
+ enum availability avail;
+ struct cgraph_node *callee = cgraph_function_node (e->callee, &avail);
+
+ if (avail <= AVAIL_OVERWRITABLE)
+ read_write_all_from_decl (callee, &read_all, &write_all);
+ }
for (ie = w->indirect_calls; ie; ie = ie->next_callee)
if (!(ie->indirect_info->ecf_flags & ECF_CONST))