From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7088 invoked by alias); 28 Feb 2014 17:20:36 -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 7047 invoked by uid 48); 28 Feb 2014 17:20:32 -0000 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/60150] [4.9 Regression] ICE in function_and_variable_visibility, at ipa.c:1000 Date: Fri, 28 Feb 2014 17:20: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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status assigned_to 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-02/txt/msg02852.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60150 Jan Hubicka changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |hubicka at gcc dot gnu.org --- Comment #2 from Jan Hubicka --- OK, this is ordering issue in the localization process: we localize comdat groups one by one, but we also copy visibilities from functions to thunks (that is somewhat useless fixup at LTO time). This patch makes the comdat group localization to happen all at once. Index: ipa.c =================================================================== --- ipa.c (revision 207934) +++ ipa.c (working copy) @@ -970,15 +970,32 @@ function_and_variable_visibility (bool w gcc_assert (whole_program || in_lto_p || !TREE_PUBLIC (node->decl)); node->unique_name = ((node->resolution == LDPR_PREVAILING_DEF_IRONLY - || node->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP) - && TREE_PUBLIC (node->decl)); + || node->unqiue_name + || node->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP) + && TREE_PUBLIC (node->decl)); node->resolution = LDPR_PREVAILING_DEF_IRONLY; if (node->same_comdat_group && TREE_PUBLIC (node->decl)) - /* cgraph_externally_visible_p has already checked all other nodes - in the group and they will all be made local. We need to - dissolve the group at once so that the predicate does not - segfault though. */ - symtab_dissolve_same_comdat_group_list (node); + { + symtab_node *next = node; + + /* Set all members of comdat group local. */ + if (node->same_comdat_group) + for (next = node->same_comdat_group; + next != node; + next = next->same_comdat_group) + { + symtab_make_decl_local (next->decl); + next->unique_name = ((next->resolution == LDPR_PREVAILING_DEF_IRONLY + || next->unqiue_name + || next->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP) + && TREE_PUBLIC (next->decl)); + } + /* cgraph_externally_visible_p has already checked all other nodes + in the group and they will all be made local. We need to + dissolve the group at once so that the predicate does not + segfault though. */ + symtab_dissolve_same_comdat_group_list (node); + } symtab_make_decl_local (node->decl); }