From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 236603870856; Sat, 4 Jul 2020 10:44:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 236603870856 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593859494; bh=v7tqmeZFFrUfwftNkq7YYvNCuxSURpwxYIjHe3jfkko=; h=From:To:Subject:Date:From; b=NmjxZHobdgyKiWbLaNMctYHKeJfFQ8nxT7t4dLJG6yTITjZZh4gEFKbdVSXA7tPYX 8pbHA3M6j9orhcT7N3DRdsI5h4yQu+3dDLPIZ2OPLyGKqIqcE992hASGh/j9yXBpYf szFPfKRDVJFHlelWu4kCPQgwynSEWC5e5HRn/rqY= From: "krzysztof.a.nowicki+gcc at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/96059] New: ICE: in remove_unreachable_nodes, at ipa.c:575 with -fdevirtualize-at-ltrans Date: Sat, 04 Jul 2020 10:44:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: krzysztof.a.nowicki+gcc at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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 cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2020 10:44:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96059 Bug ID: 96059 Summary: ICE: in remove_unreachable_nodes, at ipa.c:575 with -fdevirtualize-at-ltrans Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: krzysztof.a.nowicki+gcc at gmail dot com CC: marxin at gcc dot gnu.org Target Milestone: --- When building the ktexteditor-5.71 from the KDE Frameworks with LTO enabled= I'm seeing an ICE when linking libKF5TextEditor.so: during IPA pass: inline lto1: internal compiler error: in remove_unreachable_nodes, at ipa.c:575 0xa7e802 symbol_table::remove_unreachable_nodes(_IO_FILE*) /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/ipa.c:= 575 0x19cb14f ipa_inline =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/ipa-inline.c:2= 696 0x19cb702 execute =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/ipa-inline.c:3= 091 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. GDB backtrace: #0 internal_error (gmsgid=3Dgmsgid@entry=3D0x233d39a "in %s, at %s:%d") at /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/diagnostic.c:1= 706 #1 0x0000000001b09d9a in fancy_abort (file=3Dfile@entry=3D0x1c07468 "/var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/ipa.c", line=3Dline@entry=3D575, function=3Dfunction@entry=3D0x1c073fc "remove_unreachable_nodes") at /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/diagnostic.c:1= 778 #2 0x0000000000a7e803 in symbol_table::remove_unreachable_nodes (this=3D0x7ffff6e8d100, file=3D0x0) at /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/ipa.c:577 #3 0x00000000019cb150 in ipa_inline () at /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/ipa-inline.c:2= 696 #4 0x00000000019cb703 in (anonymous namespace)::pass_ipa_inline::execute (this=3D) at /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/ipa-inline.c:3= 091 #5 0x0000000000c047a3 in execute_one_pass (pass=3Dpass@entry=3D0x3edc4a0) = at /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/passes.c:2502 #6 0x0000000000c06052 in execute_ipa_pass_list (pass=3D0x3edc4a0) at /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/passes.c:2929 #7 0x00000000006442ac in do_whole_program_analysis () at /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/context.h:48 #8 0x00000000006445f7 in lto_main () at /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/lto/lto.c:637 #9 0x0000000000d1844d in compile_file () at /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/toplev.c:458 #10 0x0000000000d1b891 in do_compile () at /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/toplev.c:2277 #11 0x0000000000d1c1fd in toplev::main (this=3Dthis@entry=3D0x7fffffffd7f6, argc=3D, argc@entry=3D36, argv=3D, argv@entry=3D0x7fffffffd8f8) at /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/toplev.c:2416 #12 0x0000000001ae9eeb in main (argc=3D36, argv=3D0x7fffffffd8f8) at /var/tmp/portage/sys-devel/gcc-10.1.0-r1/work/gcc-10.1.0/gcc/main.c:39 CXXFLAGS: -O2 -pipe -march=3Dskylake -flto=3D3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition The ICE goes away after removing the -fdevirtualize-at-ltrans flag. The backtrace above was generated from Gentoo-patched version of GCC, but i= t's also reproducible with a vanilla version compiled directly from sources. This is a regression since GCC 10 (reproducible also with latest GCC 11 tru= nk), as GCC 9 compiles this package with the same CXXFLAGS without issues. I've bisected the regression to the following commit: commit 2bc2379be5c98d34ecbb347b2abf059aa6d94499 Author: Jan Hubicka Date: Mon Nov 4 20:39:52 2019 +0100 ipa-inline-transform.c: Include ipa-utils.h * ipa-inline-transform.c: Include ipa-utils.h (inline_call): Set thunk_expansion flag. * ipa-utils.h (thunk_expansion): Declare. * ipa-devirt.c (thunk_expansion): New global var. (devirt_node_removal_hook): Do not invalidate cache while doing thunk expansion. From-SVN: r277789 Maybe the "HACK alert" in the commit diff has something to do with it :)=