From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15296 invoked by alias); 11 Dec 2013 12:52:21 -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 15262 invoked by uid 48); 11 Dec 2013 12:52:15 -0000 From: "d.g.gorbachev at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/59468] New: ICE on invalid C++ code with LTO in gimple_get_virt_method_for_binfo, at gimple-fold.c:3224 Date: Wed, 11 Dec 2013 12:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: d.g.gorbachev at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: 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: 2013-12/txt/msg00953.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59468 Bug ID: 59468 Summary: ICE on invalid C++ code with LTO in gimple_get_virt_method_for_binfo, at gimple-fold.c:3224 Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: d.g.gorbachev at gmail dot com Created attachment 31416 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31416&action=edit Testcase (compile with `-O2 -flto -shared') GCC 4.9.0 20131208 (experimental) - r205795. lto1: internal compiler error: in gimple_get_virt_method_for_binfo, at gimple-fold.c:3224 0x8408889 gimple_get_virt_method_for_binfo(long long, tree_node*) ../../gcc-4.9/gcc/gimple-fold.c:3223 0x845f414 record_target_from_binfo ../../gcc-4.9/gcc/ipa-devirt.c:667 0x845f4f2 record_target_from_binfo ../../gcc-4.9/gcc/ipa-devirt.c:684 0x845f4f2 record_target_from_binfo ../../gcc-4.9/gcc/ipa-devirt.c:684 0x845f609 possible_polymorphic_call_targets_1 ../../gcc-4.9/gcc/ipa-devirt.c:708 0x845f670 possible_polymorphic_call_targets_1 ../../gcc-4.9/gcc/ipa-devirt.c:714 0x8460e0f possible_polymorphic_call_targets(tree_node*, long long, ipa_polymorphic_call_context, bool*, void**) ../../gcc-4.9/gcc/ipa-devirt.c:1295 0x8265d1d possible_polymorphic_call_targets(cgraph_edge*, bool*, void**) ../../gcc-4.9/gcc/ipa-utils.h:114 0x848cd5d walk_polymorphic_call_targets ../../gcc-4.9/gcc/ipa.c:174 0x848d40a symtab_remove_unreachable_nodes(bool, _IO_FILE*) ../../gcc-4.9/gcc/ipa.c:397 0x8578656 execute_todo ../../gcc-4.9/gcc/passes.c:1884 Some older 4.9.0 builds give a message like "lto1: fatal error: LTO_tags out of range: Range is 0 to 353, value is 356". Other builds, such as 4.9.0 20131027 (r204109) crash with: lto1: internal compiler error: Segmentation fault 0x85c19c0 crash_signal ../../gcc-4.9/gcc/toplev.c:334 0x84953be lto_file_decl_data_get_var_decl ../../gcc-4.9/gcc/lto-streamer.h:1190 0x84953be lto_input_tree_ref(lto_input_block*, data_in*, function*, LTO_tags) ../../gcc-4.9/gcc/lto-streamer-in.c:244 0x849553a lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int) ../../gcc-4.9/gcc/lto-streamer-in.c:1242 0x81403ae lto_read_decls ../../gcc-4.9/gcc/lto/lto.c:1914 0x8140726 lto_file_finalize ../../gcc-4.9/gcc/lto/lto.c:2167 0x8140764 lto_create_files_from_ids ../../gcc-4.9/gcc/lto/lto.c:2177 0x8140822 lto_file_read ../../gcc-4.9/gcc/lto/lto.c:2217 0x8140b51 read_cgraph_and_symbols ../../gcc-4.9/gcc/lto/lto.c:2823 0x81410c9 lto_main() ../../gcc-4.9/gcc/lto/lto.c:3254 With GCC 4.7.4: In file included from 1.C:25:0, from :12: 2.C:15:8: warning: type of '_ZTV1S' does not match original declaration [enabled by default] In file included from :8:0: 1.C:15:8: note: previously declared here In file included from 1.C:25:0, from :12: 2.C:6:8: warning: type of '_ZTV1X' does not match original declaration [enabled by default] In file included from :4:0: 1.C:6:8: note: previously declared here There are no errors or warnings with GCC 4.8.3.