From 5806d9ac5dc72814e806e61773077a263a6fc728 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 5 Oct 2010 18:15:00 +0200 Subject: cgraphunit.c (assemble_function): Output thunks and aliases before the function itself. * cgraphunit.c (assemble_function): Output thunks and aliases before the function itself. From-SVN: r164994 --- gcc/cgraphunit.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'gcc/cgraphunit.c') diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index b51a71c..e9d1f1d 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1470,15 +1470,6 @@ cgraph_expand_function (struct cgraph_node *node) announce_function (decl); node->process = 0; - - gcc_assert (node->lowered); - - /* Generate RTL for the body of DECL. */ - tree_rest_of_compilation (decl); - - /* Make sure that BE didn't give up on compiling. */ - gcc_assert (TREE_ASM_WRITTEN (decl)); - current_function_decl = NULL; if (node->same_body) { struct cgraph_node *alias, *next; @@ -1498,7 +1489,17 @@ cgraph_expand_function (struct cgraph_node *node) assemble_thunk (alias); } node->alias = saved_alias; + cgraph_process_new_functions (); } + + gcc_assert (node->lowered); + + /* Generate RTL for the body of DECL. */ + tree_rest_of_compilation (decl); + + /* Make sure that BE didn't give up on compiling. */ + gcc_assert (TREE_ASM_WRITTEN (decl)); + current_function_decl = NULL; gcc_assert (!cgraph_preserve_function_body_p (decl)); cgraph_release_function_body (node); /* Eliminate all call edges. This is important so the GIMPLE_CALL no longer -- cgit v1.1