From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E9DAF3858C2F; Mon, 22 Jan 2024 12:26:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E9DAF3858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705926400; bh=3hTzJCm0DO+rP8q64A1zBmDFC9l3BfKsdPN64aNL5C0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HkLCaUrj/g9LbUWkoxNXsOY3+t7PxLNzu5MiTozrXTBrj4pf/55821VhZzgG0Q7kh 34u+jqeMHNthyULWn3vwnbI0eiVNM4j5GRkHGfoR45lq5ZNN7XRqIc2gJ3wd8Vv1Pl sIGIUxddhAwiv8t9jWBBxtxEu4w9CyQHL87EUDGg= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113466] ICE: verify_flow_info failed: returns_twice call is not first in basic block 7 with a __returns_twice__ function with _BitInt() argument Date: Mon, 22 Jan 2024 12:26:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW 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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113466 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org --- Comment #2 from Jakub Jelinek --- The question is what we can do about it. bitint_large_huge::lower_call wants for the large/huge BITINT_TYPE SSA_NAME call arguments (with the exception of uninitialized ones) add a load before= the call, which loads the argument from some VAR_DECL or PARM_DECL etc. And the CFG requirements for returns_twice calls is that there is an abnorm= al edge from the .ABNORMAL_DISPATCHER block to the start of the call, so we ca= n't insert anything before the call. Now, in fixes like PR109410 this was easy because reassoc is adding those statements to the start of the function, so we can easily split the ENTRY -> bb2 edge and insert stuff there. But here it is much more complicated. In the easier case, we have just one EDGE_FALLTHRU predecessor edge plus the EDGE_ABNORMAL edge. I guess we can in that case insert on that EDGE_FALLTHRU edge, but then the= re is a question if one can just use the SSA_NAME in the return argument or no= t. If there is just one call like in the #c0 case, that is most likely the cas= e, but what about say: void foo (_BitInt(6321)) __attribute__((returns_twice)); void baz (void); void bar (_BitInt(6321) x) { foo (x); baz (); foo (x + 1); baz (); } One can insert the load from x on the entry edge because that dominates the .ABNORMAL_DISPATCHER bb, but guess for the _1 (x + 1) load we need some PHI= and it isn't clear to me what to use on the edge from the abnormal dispatcher (= and whether to use some PHI on the .ABNORMAL_DISPATCHER bb as well). And, if the bb with returns_twice call contains multiple predecessor edges = and even worse say next to the .ABNORMAL_DISPATCHER abnormal edge some EDGE_EH = or similar incoming edges, probably need to add some bb before the returns_twi= ce bb but then no idea what to do with PHIs etc. Or we could for the time being just sorry on returns_twice calls with large/huge _BitInt arguments.=