From bcb650cbb87954272436b03e1cccf795ec7e777a Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sat, 7 Sep 2013 09:48:59 +0200 Subject: [PATCH] cgraphunit.c (expand_thunk): Get body before touching arguments. * cgraphunit.c (expand_thunk): Get body before touching arguments. * lto-streamer-out.c: Stream thunks, too. * lto-streamer-in.c (input_function): Pop cfun here (lto_read_body): Instead of here. From-SVN: r202352 --- gcc/ChangeLog | 7 +++++++ gcc/cgraphunit.c | 6 +++++- gcc/lto-streamer-in.c | 3 +-- gcc/lto-streamer-out.c | 3 +-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 34ae31ff0e1..98cda853635 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-09-06 Jan Hubicka + + * cgraphunit.c (expand_thunk): Get body before touching arguments. + * lto-streamer-out.c: Stream thunks, too. + * lto-streamer-in.c (input_function): Pop cfun here + (lto_read_body): Instead of here. + 2013-09-06 Caroline Tice * doc/install.texi: Add documentation for the --enable-vtable-verify diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 08e0ff277f2..1afdd439dda 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1433,7 +1433,11 @@ expand_thunk (struct cgraph_node *node) tree virtual_offset = NULL; tree alias = node->callees->callee->symbol.decl; tree thunk_fndecl = node->symbol.decl; - tree a = DECL_ARGUMENTS (thunk_fndecl); + tree a; + + if (in_lto_p) + cgraph_get_body (node); + a = DECL_ARGUMENTS (thunk_fndecl); current_function_decl = thunk_fndecl; diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index f1d5935c427..7fa5bb34e58 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -998,6 +998,7 @@ input_function (tree fn_decl, struct data_in *data_in, free_dominance_info (CDI_DOMINATORS); free_dominance_info (CDI_POST_DOMINATORS); free (stmts); + pop_cfun (); } @@ -1086,8 +1087,6 @@ lto_read_body (struct lto_file_decl_data *file_data, struct cgraph_node *node, /* Restore decl state */ file_data->current_decl_state = file_data->global_decl_state; - - pop_cfun (); } lto_data_in_delete (data_in); diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index f27f2fd9aff..c46f71032af 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -1985,8 +1985,7 @@ lto_output (void) cgraph_node *node = dyn_cast (snode); if (node && lto_symtab_encoder_encode_body_p (encoder, node) - && !node->symbol.alias - && !node->thunk.thunk_p) + && !node->symbol.alias) { #ifdef ENABLE_CHECKING gcc_assert (!bitmap_bit_p (output, DECL_UID (node->symbol.decl)));