From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1AB2D3844013; Thu, 24 Sep 2020 10:31:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1AB2D3844013 From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/96394] [10/11 Regression] ICE in add_new_edges_to_heap, at ipa-inline.c:1746 (-O3 PGO) Date: Thu, 24 Sep 2020 10:31:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: target_milestone priority cc Message-ID: In-Reply-To: References: 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: Thu, 24 Sep 2020 10:31:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96394 Martin Li=C5=A1ka changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |10.3 Priority|P3 |P1 CC| |jamborm at gcc dot gnu.org --- Comment #13 from Martin Li=C5=A1ka --- Thank you Sergei for the reduced test-case. What happens: (gdb) p ie->caller->debug() ai/1 (ai) @0x7ffff772b168 Type: function definition analyzed Visibility: prevailing_def_ironly previous sharing asm name: 8 References: table/5 (addr) ap/4 (addr) (speculative) ag/0 (addr) (speculative)=20 Referring:=20 Function ai/1 is inline copy in h/3 Availability: local Profile id: 1923518911 Function flags: count:4 (precise) first_run:4 body local hot Called by: h/3 (inlined) (4 (precise),1.00 per call)=20 Calls: ag/7 (speculative) (inlined) (2 (adjusted),0.50 per call) ap/4 (speculative) (2 (adjusted),0.50 per call) PyErr_Format/6 (0 (precise),0.00= per call)=20 Indirect call(speculative) (0 (adjusted),0.00 per call) of param:1 (vptr maybe changed) Num speculative call targets: 2 We first enqueu the edge ai/1 -> ap/4 and then ipa_make_edge_direct_to_targ= et is called for the Indirect call (with speculative=3Dfalse) and we end up: (gdb) p ie->caller->debug() ai/1 (ai) @0x7ffff772b168 Type: function definition analyzed Visibility: prevailing_def_ironly previous sharing asm name: 8 References: table/5 (addr)=20 Referring:=20 Function ai/1 is inline copy in h/3 Availability: local Profile id: 1923518911 Function flags: count:4 (precise) first_run:4 body local hot Called by: h/3 (inlined) (4 (precise),1.00 per call)=20 Calls: ap/4 (4 (adjusted),1.00 per call) PyErr_Format/6 (0 (precise),0.00= per call)=20 and we add the edge again to the heap in ipa-prop: 3830 new_edges->safe_push (new_direct_edge); and we ICE due to that. I tried not to add the edge in case new_direct_edge->aux is NULL, but a sanity check in inliner fails: during IPA pass: inline parsermodule.c:35:1: internal compiler error: in estimate_calls_size_and_ti= me, at ipa-fnsummary.c:3328 35 | int ap(entry *j) { return ai(j, ag, 14, 4); } | ^~~ So I guess a profile masage is needed. Leaving to Martin as he's more famil= iar with IPA PROP. Something similar to ipa-prop.c:3309-3316?=