aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2011-03-28 14:15:44 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2011-03-28 14:15:44 +0200
commit322dd85963282f7b28ae25ccaafbf45ab2c9145d (patch)
treeaf67dd327ad63f08a6c47d5f6e9ec258c665e64e
parentaa53e58b920d4fe4bbdb26e227401ad827c52a57 (diff)
downloadgcc-322dd85963282f7b28ae25ccaafbf45ab2c9145d.zip
gcc-322dd85963282f7b28ae25ccaafbf45ab2c9145d.tar.gz
gcc-322dd85963282f7b28ae25ccaafbf45ab2c9145d.tar.bz2
tree-inline.c (expand_call_inline): Do not check that destination node is analyzed.
2011-03-28 Martin Jambor <mjambor@suse.cz> * tree-inline.c (expand_call_inline): Do not check that destination node is analyzed. (optimize_inline_calls): Assert that destination node is analyzed. * cgraph.c (cgraph_add_new_function): Call cgraph_analyze_function, do not call tree_lowering_passes. * cgraph.h (cgraph_analyze_function): Declare. * cgraphunit.c (cgraph_analyze_function): Make public. From-SVN: r171602
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/cgraph.c6
-rw-r--r--gcc/cgraph.h1
-rw-r--r--gcc/cgraphunit.c3
-rw-r--r--gcc/tree-inline.c6
5 files changed, 17 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index da0fa52..dcc5e1c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2011-03-28 Martin Jambor <mjambor@suse.cz>
+
+ * tree-inline.c (expand_call_inline): Do not check that destination
+ node is analyzed.
+ (optimize_inline_calls): Assert that destination node is analyzed.
+ * cgraph.c (cgraph_add_new_function): Call cgraph_analyze_function, do
+ not call tree_lowering_passes.
+ * cgraph.h (cgraph_analyze_function): Declare.
+ * cgraphunit.c (cgraph_analyze_function): Make public.
+
2011-03-28 Joseph Myers <joseph@codesourcery.com>
* config/sparc/sparc-opts.h: New.
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 64d278f..3cf75f2 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -2495,11 +2495,13 @@ cgraph_add_new_function (tree fndecl, bool lowered)
case CGRAPH_STATE_FINISHED:
/* At the very end of compilation we have to do all the work up
to expansion. */
+ node = cgraph_node (fndecl);
+ if (lowered)
+ node->lowered = true;
+ cgraph_analyze_function (node);
push_cfun (DECL_STRUCT_FUNCTION (fndecl));
current_function_decl = fndecl;
gimple_register_cfg_hooks ();
- if (!lowered)
- tree_lowering_passes (fndecl);
bitmap_obstack_initialize (NULL);
if (!gimple_in_ssa_p (DECL_STRUCT_FUNCTION (fndecl)))
execute_pass_list (pass_early_local_passes.pass.sub);
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index e2d2f50..e774c00 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -618,6 +618,7 @@ bool varpool_used_from_object_file_p (struct varpool_node *node);
extern FILE *cgraph_dump_file;
void cgraph_finalize_function (tree, bool);
void cgraph_mark_if_needed (tree);
+void cgraph_analyze_function (struct cgraph_node *);
void cgraph_finalize_compilation_unit (void);
void cgraph_optimize (void);
void cgraph_mark_needed_node (struct cgraph_node *);
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index e6a0ea6..c397fe5 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -143,7 +143,6 @@ static void cgraph_expand_all_functions (void);
static void cgraph_mark_functions_to_output (void);
static void cgraph_expand_function (struct cgraph_node *);
static void cgraph_output_pending_asms (void);
-static void cgraph_analyze_function (struct cgraph_node *);
FILE *cgraph_dump_file;
@@ -773,7 +772,7 @@ cgraph_output_pending_asms (void)
}
/* Analyze the function scheduled to be output. */
-static void
+void
cgraph_analyze_function (struct cgraph_node *node)
{
tree save = current_function_decl;
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index fd8edb4..8c8aef6 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -3766,11 +3766,6 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
if (gimple_code (stmt) != GIMPLE_CALL)
goto egress;
- /* Objective C and fortran still calls tree_rest_of_compilation directly.
- Kill this check once this is fixed. */
- if (!id->dst_node->analyzed)
- goto egress;
-
cg_edge = cgraph_edge (id->dst_node, stmt);
gcc_checking_assert (cg_edge);
/* First, see if we can figure out what function is being called.
@@ -4203,6 +4198,7 @@ optimize_inline_calls (tree fn)
memset (&id, 0, sizeof (id));
id.src_node = id.dst_node = cgraph_node (fn);
+ gcc_assert (id.dst_node->analyzed);
id.dst_fn = fn;
/* Or any functions that aren't finished yet. */
if (current_function_decl)