From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5322 invoked by alias); 4 Oct 2014 22:00:03 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 5173 invoked by uid 48); 4 Oct 2014 21:59:59 -0000 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/62026] [4.9/5 Regression] Crash in lto_get_decl_name_mapping Date: Sat, 04 Oct 2014 22:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: ice-on-valid-code, lto X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-10/txt/msg00302.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62026 --- Comment #14 from Jan Hubicka --- I am testing the following for 4.9-branch: Index: cgraphclones.c =================================================================== --- cgraphclones.c (revision 215890) +++ cgraphclones.c (working copy) @@ -310,6 +310,8 @@ duplicate_thunk_for_node (cgraph_node *t if (thunk_of->thunk.thunk_p) node = duplicate_thunk_for_node (thunk_of, node); + cgraph_get_body (thunk); + struct cgraph_edge *cs; for (cs = node->callers; cs; cs = cs->next_caller) if (cs->caller->thunk.thunk_p Index: lto-streamer-out.c =================================================================== --- lto-streamer-out.c (revision 215890) +++ lto-streamer-out.c (working copy) @@ -2077,7 +2077,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 (node);