summaryrefslogtreecommitdiff
path: root/gcc/ipa-utils.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-18 18:39:52 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-18 18:39:52 +0000
commit17b28e52019eff5c40389d7c25d6da967bb6f8c9 (patch)
tree605c8e1d928935149f9367d15c77d8c439de199f /gcc/ipa-utils.c
parent1eecdb280eac3d85d7d606225c14c4f99428a62c (diff)
downloadgcc-17b28e52019eff5c40389d7c25d6da967bb6f8c9.tar.gz
* cgraph.c (cgraph_make_edge, dump_cgraph_node, cgraph_set_call_stmt):
Set nothrow flag. * cgraph.h (struct function): Reduce loop_nest to 30 bits; add can_throw_external flag. * ipa-reference.c (ipa_utils_reduced_inorder): Update call. * ipa-pure-const.c (ignore_edge): New function. (propagate): Compute order for NOTHROW computation; set NOTHROWs only over can_throw_external edges. (local_pure_const): Add nothrow flag. * ipa-utils.c (searchc): Add ignore_edge callback. (ipa_utils_reduced_inorder): Add ignore_edge callback. * ipa-utils.h (ipa_utils_reduced_inorder): Update prototype. (set_nothrow_function_flags): Update cgraph. * tree-cfg.c (verify_stmt): Relax nothrow checking when in IPA mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146322 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-utils.c')
-rw-r--r--gcc/ipa-utils.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/ipa-utils.c b/gcc/ipa-utils.c
index 3b5d128f60d..2fe0396b496 100644
--- a/gcc/ipa-utils.c
+++ b/gcc/ipa-utils.c
@@ -81,7 +81,8 @@ struct searchc_env {
searching from. */
static void
-searchc (struct searchc_env* env, struct cgraph_node *v)
+searchc (struct searchc_env* env, struct cgraph_node *v,
+ bool (*ignore_edge) (struct cgraph_edge *))
{
struct cgraph_edge *edge;
struct ipa_dfs_info *v_info = (struct ipa_dfs_info *) v->aux;
@@ -101,12 +102,15 @@ searchc (struct searchc_env* env, struct cgraph_node *v)
struct ipa_dfs_info * w_info;
struct cgraph_node *w = edge->callee;
+ if (ignore_edge && ignore_edge (edge))
+ continue;
+
if (w->aux && cgraph_function_body_availability (edge->callee) > AVAIL_OVERWRITABLE)
{
w_info = (struct ipa_dfs_info *) w->aux;
if (w_info->new_node)
{
- searchc (env, w);
+ searchc (env, w, ignore_edge);
v_info->low_link =
(v_info->low_link < w_info->low_link) ?
v_info->low_link : w_info->low_link;
@@ -152,7 +156,8 @@ searchc (struct searchc_env* env, struct cgraph_node *v)
int
ipa_utils_reduced_inorder (struct cgraph_node **order,
- bool reduce, bool allow_overwritable)
+ bool reduce, bool allow_overwritable,
+ bool (*ignore_edge) (struct cgraph_edge *))
{
struct cgraph_node *node;
struct searchc_env env;
@@ -193,7 +198,7 @@ ipa_utils_reduced_inorder (struct cgraph_node **order,
while (result)
{
node = (struct cgraph_node *)result->value;
- searchc (&env, node);
+ searchc (&env, node, ignore_edge);
result = splay_tree_min (env.nodes_marked_new);
}
splay_tree_delete (env.nodes_marked_new);