diff options
author | Jan Hubicka <jh@suse.cz> | 2011-06-10 12:15:30 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2011-06-10 10:15:30 +0000 |
commit | fede8efad0bfa82997fd1ff49f84eb493231ca23 (patch) | |
tree | 48d43b22dfa25b1fd6a1b3335c96ecedb737ae09 /gcc/ipa-pure-const.c | |
parent | 0127c76f613c84e31efdc6b1c6d1634718b8f691 (diff) | |
download | gcc-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-pure-const.c')
-rw-r--r-- | gcc/ipa-pure-const.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index 74cf52a..b56e48a 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -735,7 +735,7 @@ analyze_function (struct cgraph_node *fn, bool ipa) flags_from_decl_or_type (fn->decl), cgraph_node_cannot_return (fn)); - if (fn->thunk.thunk_p) + if (fn->thunk.thunk_p || fn->alias) { /* Thunk gets propagated through, so nothing interesting happens. */ gcc_assert (ipa); @@ -1070,14 +1070,16 @@ ignore_edge (struct cgraph_edge *e) return (!e->can_throw_external); } -/* Return true if NODE is self recursive function. */ +/* Return true if NODE is self recursive function. + ??? self recursive and indirectly recursive funcions should + be the same, so this function seems unnecesary. */ static bool self_recursive_p (struct cgraph_node *node) { struct cgraph_edge *e; for (e = node->callees; e; e = e->next_callee) - if (e->callee == node) + if (cgraph_function_node (e->callee, NULL) == node) return true; return false; } @@ -1167,7 +1169,8 @@ propagate_pure_const (void) /* Now walk the edges and merge in callee properties. */ for (e = w->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); enum pure_const_state_e edge_state = IPA_CONST; bool edge_looping = false; @@ -1178,7 +1181,7 @@ propagate_pure_const (void) cgraph_node_name (e->callee), e->callee->uid); } - if (cgraph_function_body_availability (y) > AVAIL_OVERWRITABLE) + if (avail > AVAIL_OVERWRITABLE) { funct_state y_l = get_function_state (y); if (dump_file && (dump_flags & TDF_DETAILS)) @@ -1396,9 +1399,10 @@ propagate_nothrow (void) for (e = w->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); - if (cgraph_function_body_availability (y) > AVAIL_OVERWRITABLE) + if (avail > AVAIL_OVERWRITABLE) { funct_state y_l = get_function_state (y); |