From 48fb6d4090508e8dde8aaa95b366c2489f62950b Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 15 Oct 2014 19:01:08 +0200 Subject: re PR lto/62026 (Crash in lto_get_decl_name_mapping) PR lto/62026 * lto/pr62026.C: New testcase. * cgraphclones.c (duplicate_thunk_for_node): Get body to have args to duplicate. * lto-streamer-out.c (lto_output): Handle correctly thunks that was born at WPA time. From-SVN: r216278 --- gcc/lto-streamer-out.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/lto-streamer-out.c') diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index dad751b..6d1384f 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -2249,7 +2249,10 @@ lto_output (void) #endif decl_state = lto_new_out_decl_state (); lto_push_out_decl_state (decl_state); - if (gimple_has_body_p (node->decl) || !flag_wpa) + if (gimple_has_body_p (node->decl) || !flag_wpa + /* Thunks have no body but they may be synthetized + at WPA time. */ + || DECL_ARGUMENTS (node->decl)) output_function (node); else copy_function_or_variable (node); -- cgit v1.1