From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110399 invoked by alias); 2 Mar 2015 23:29:24 -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 110148 invoked by uid 48); 2 Mar 2015 23:29:21 -0000 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/65277] [5 Regression] ice in get_untransformed_body with -O2 Date: Mon, 02 Mar 2015 23:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 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: 2015-03/txt/msg00220.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65277 --- Comment #4 from Jan Hubicka --- get_untransformed_body should turn itself into noop in !in_lto_p compilation as all function bodies have DECL_RESULT. (it probably deserves comment, but that way we check if the body was read) Formatting is off: for (i = new_order_pos - 1; i >= 0; i--) { node = order[i]; if (node->process) { expanded_func_count++; if(node->tp_first_run) profiled_func_count++; if (symtab->dump_file) fprintf (symtab->dump_file, "Time profile order in expand_all_functions:%s:%d\n", node->asm_name (), node->tp_first_run); node->process = 0; node->expand (); } } but actual code makes sense. Node in question is: _ZTch0_v0_n40_N3Ent4ThisEv/7 (virtual Ent& Ent::_ZTch0_v0_n40_N3Ent4ThisEv()) @0x7ffff6c5d620 Type: function Body removed by symtab_remove_unreachable_nodes Visibility: externally_visible public weak comdat comdat_group:_ZN3Ent4ThisEv one_only section:.text._ZN3Ent4ThisEv (implicit_section) virtual artificial Same comdat group as: _ZN3Ent4ThisEv/5 References: Referring: Availability: not_available First run: 0 Function flags: icf_merged Called by: Calls: it was removed, so it is wrong that we try to output it. The removal happens in ipa-icf and it is based on cgraph_can_remove_if_no_direct_calls_p being wrong - if symbol is in comdat group removing all direct calls to it may not make it removable if other symbols hold it around... Will fix that.