aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-13 19:39:48 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-13 19:39:48 +0000
commitbd950517e54bb3a14c21ddd75c7e7b237e5ff1a4 (patch)
treea2fd7a8d864bcb04b23ab0de287eb1183448e964 /gcc/tree-inline.c
parent9a935c197c005be10d19e3c85497c52652048504 (diff)
* timevar.def (TV_TREE_STMT_VERIFY, TV_CFG_VERIFY, TV_CGRAPH_VERIFY):
New timers. * tree-cfg.c (verify_stmts): Push/pop timevar. * cfg.c: Include timevar.h (verify_flow_info): Push/pop timevar. * Makefile.in (cfg.o): Add dependnecy on TIMEVARS * cgraph.c (cgraph_create_edge): Sanity check for duplicates; initialize aux. (cgraph_remove_node): Decrease cgraph_n_nodes; do not clear DECL_SAVED_TREE when dumping. (cgraph_dump_node): Break out from ...; print more information. (cgraph_dump): ... here. * cgraph.h (cgraph_node): Add aux field. (dump_cgraph_node, verify_cgraph, verify_cgraph_node): Declare. (cgraph_mark_inline_edge): Declare * cgraphunit.c (error_found): New static variable. (verify_cgraph_node_1): New static function. (verify_cgraph_node, verify_cgraph): New global function. (cgraph_expand_function): More sanity checks. (cgraph_clone_inline_nodes): Destructivly clone DECL_EXTERNAL nodes. (cgraph_mark_inline_edge): Make global. (cgraph_decide_inlining): Remove extern inline functions never inlined. (cgraph_decide_inlining_incrementally): Verify that function body is still present. (expand_all_functions): Verify that all nodes are reachable. (cgraph_optimize): Verify cgraph and memory management. * tree-inline.c (copy_body_r): All edges must be present. (expand_call_inline): Sanity check newly created edges and nodes being inlined. (optimize_inline_calls): Sanity check that we've inlined everything. * tree-optimize.c (tree_rest_of_compilation): Clone functions inlined into cloned node. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@74606 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 3975a84a1da..82c556bf380 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -643,6 +643,8 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
edge = cgraph_edge (node, old_node);
if (edge)
edge->call_expr = *tp;
+ else
+ abort ();
}
}
else
@@ -1437,16 +1439,25 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
&& DECL_SAVED_TREE (DECL_ABSTRACT_ORIGIN (fn)))
fn = DECL_ABSTRACT_ORIGIN (fn);
+ /* Objective C and fortran still calls tree_rest_of_compilation directly.
+ Kill this check once this is fixed. */
+ if (!id->current_node->analyzed)
+ goto egress;
+
edge = cgraph_edge (id->current_node, t);
/* Constant propagation on argument done during previous inlining
may create new direct call. Produce an edge for it. */
if (!edge)
{
- cgraph_create_edge (id->node, cgraph_node (fn), t);
+ struct cgraph_node *dest = cgraph_node (fn);
+
+ /* FN must have address taken so it can be passed as argument. */
+ if (!dest->needed)
+ abort ();
+ cgraph_create_edge (id->node, dest, t);
goto egress;
}
-
/* Don't try to inline functions that are not well-suited to
inlining. */
@@ -1461,6 +1472,10 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
goto egress;
}
+#ifdef ENABLE_CHECKING
+ verify_cgraph_node (edge->callee);
+#endif
+
if (! (*lang_hooks.tree_inlining.start_inlining) (fn))
goto egress;
@@ -1801,6 +1816,19 @@ optimize_inline_calls (tree fn)
VARRAY_ACTIVE_SIZE (id.inlined_fns) * sizeof (tree));
DECL_INLINED_FNS (fn) = ifn;
}
+
+#ifdef ENABLE_CHECKING
+ {
+ struct cgraph_edge *e;
+
+ verify_cgraph_node (id.node);
+
+ /* Double check that we inlined everything we are supposed to inline. */
+ for (e = id.node->callees; e; e = e->next_callee)
+ if (e->inline_call)
+ abort ();
+ }
+#endif
}
/* FN is a function that has a complete body, and CLONE is a function