From 0537adb738a4df4ec7e07fee5fef72c745dd61ed Mon Sep 17 00:00:00 2001 From: Ollie Wild Date: Fri, 16 May 2008 22:02:13 +0000 Subject: gcc/lto/ * lto-lang.c (tree-inline.h): Include. (lto_post_options): New function. (LANG_HOOKS_POST_OPTIONS): Define. * lto-cgraph-in.c (overwrite_node): Set node->global.insns. * lto-function-in.c (input_bb): Set TREE_BLOCK (stmt). git-svn-id: https://gcc.gnu.org/svn/gcc/branches/lto@135447 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/lto/ChangeLog | 8 ++++++++ gcc/lto/lto-cgraph-in.c | 1 + gcc/lto/lto-function-in.c | 1 + gcc/lto/lto-lang.c | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 42 insertions(+) diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 29fa8d9a374..4a6db0087c6 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,11 @@ +2008-05-16 Ollie Wild + + * lto-lang.c (tree-inline.h): Include. + (lto_post_options): New function. + (LANG_HOOKS_POST_OPTIONS): Define. + * lto-cgraph-in.c (overwrite_node): Set node->global.insns. + * lto-function-in.c (input_bb): Set TREE_BLOCK (stmt). + 2008-05-13 Diego Novillo * lto-function-in.c (input_ssa_names): Call diff --git a/gcc/lto/lto-cgraph-in.c b/gcc/lto/lto-cgraph-in.c index 2c1b387bb8d..b0536b1be63 100644 --- a/gcc/lto/lto-cgraph-in.c +++ b/gcc/lto/lto-cgraph-in.c @@ -88,6 +88,7 @@ overwrite_node (struct data_in *data_in, node->aux = (void *)tag; node->local.inline_summary.estimated_self_stack_size = stack_size; node->local.inline_summary.self_insns = self_insns; + node->global.insns = self_insns; if (!node->local.lto_file_data) node->local.lto_file_data = xcalloc (1, sizeof (struct lto_file_decl_data)); diff --git a/gcc/lto/lto-function-in.c b/gcc/lto/lto-function-in.c index 2b70f1f0791..56944febfb0 100644 --- a/gcc/lto/lto-function-in.c +++ b/gcc/lto/lto-function-in.c @@ -1472,6 +1472,7 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag, while (tag) { tree stmt = input_expr_operand (ib, data_in, fn, tag); + TREE_BLOCK (stmt) = DECL_INITIAL (fn->decl); bsi_insert_after (&bsi, stmt, BSI_NEW_STMT); LTO_DEBUG_INDENT_TOKEN ("stmt"); tag = input_record_start (ib); diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index 093e5f1f2d7..936a65b04ae 100644 --- a/gcc/lto/lto-lang.c +++ b/gcc/lto/lto-lang.c @@ -31,6 +31,7 @@ Boston, MA 02110-1301, USA. */ #include "debug.h" #include "lto-tree.h" #include "lto.h" +#include "tree-inline.h" #include "toplev.h" /* Tables of information about tree codes. */ @@ -322,6 +323,35 @@ lto_handle_option (size_t scode, const char *arg, int value) return result; } +/* Perform post-option processing. Does additional initialization based on + command-line options. PFILENAME is the main input filename. Returns false + to enable subsequent back-end initialization. */ + +static bool +lto_post_options (const char **pfilename ATTRIBUTE_UNUSED) +{ + /* Use tree inlining. */ + flag_inline_trees = 1; + + /* Other front ends have code like: + + if (!flag_no_inline) + flag_no_inline = 1; + if (flag_inline_functions) + flag_inline_trees = 2; + + As far as I can tell, though, the flag_no_inline assignment doesn't do + anything because flag_really_no_inline has already been set. + + The (flag_inline_trees == 2) condition is *only* used inside + grokdeclarator, which is never invoked inside lto1. + + I think inlining is in need of some serious cleanup. */ + + /* Initialize the compiler back end. */ + return false; +} + static bool lto_mark_addressable (tree t ATTRIBUTE_UNUSED) { @@ -619,6 +649,8 @@ static void lto_init_ts (void) #define LANG_HOOKS_INIT_OPTIONS lto_init_options #undef LANG_HOOKS_HANDLE_OPTION #define LANG_HOOKS_HANDLE_OPTION lto_handle_option +#undef LANG_HOOKS_POST_OPTIONS +#define LANG_HOOKS_POST_OPTIONS lto_post_options #define LANG_HOOKS_MARK_ADDRESSABLE lto_mark_addressable #define LANG_HOOKS_TYPE_FOR_MODE lto_type_for_mode #define LANG_HOOKS_TYPE_FOR_SIZE lto_type_for_size -- cgit v1.2.3