From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8EF2F382A2F7; Tue, 2 May 2023 20:14:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8EF2F382A2F7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683058444; bh=eqNxBkmcdezVEaMDX1r8ygC5oW6dst934b5LfxAt5Bc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=c7446/GlJgmHFf3kVAkVtQKmDdWYWO9mDuhXbSZmT0kDSws4KtOiTa3Cjse3gp9Y9 Aw7adAR2OtiJHiltVj/vLEXqwLJBjLm5vNFWSTOw81DPeKR0XHsnNCjhQ+o8CQxcEg oRDw2yLghjb8TGafZ3ejg2tyqAmLdNLtmrh46ESs= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/108596] [10/11 Regression] error: EDGE_CROSSING missing across section boundary Date: Tue, 02 May 2023 20:14:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code, inline-asm X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D108596 --- Comment #10 from CVS Commits --- The releases/gcc-11 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:9a2302a2d268c5cd0b1016d916493d7cf78f495d commit r11-10704-g9a2302a2d268c5cd0b1016d916493d7cf78f495d Author: Jakub Jelinek Date: Tue Jan 31 09:46:35 2023 +0100 bbpart: Fix up ICE on asm goto [PR108596] On the following testcase we have asm goto in hot block with 2 successo= rs, one cold to which it both falls through and has one of the label pointing to it and another hot successor with another label. Now, during bbpart we want to ensure that no blocks from one partition = fall through into a block in a different partition. fix_up_fall_thru_edges does that by temporarily clearing the EDGE_CROSSING on the fallthrough edge, calling force_nonfallthru and then depending on whether it created a new bb either set EDGE_CROSSING on the single successor edge from the new bb (the new bb is kept in the same partition as the predecessor block), or if no new bb has been created setting EDGE_CROSSING back on the fallthru edge which has been forced non-EDGE_FALLTHRU. For asm goto this doesn't always work, force_nonfallthru can create a n= ew bb and change the fallthrough edge to point to that, but if the original fallthru destination block has its label referenced among the asm goto labels, it will create a new non-fallthru edge for the label(s). But because we've temporarily cheated and cleared EDGE_CROSSING on the edge, it is cleared on the new edge as well, then the caller sees we've creat= ed a new bb and just sets EDGE_CROSSING on the single fallthru edge from t= he new bb. But the direct edge from cur_bb to fallthru edge's destination isn't handled and fails afterwards consistency checks, because it cross= es partitions. The following patch notes the case and sets EDGE_CROSSING on that edge = too. 2023-01-31 Jakub Jelinek PR rtl-optimization/108596 * bb-reorder.c (fix_up_fall_thru_edges): Handle the case where cur_bb ends with asm goto and has a crossing fallthrough edge to the s= ame bb that contains at least one of its labels by restoring EDGE_CROS= SING flag even on possible edge from cur_bb to new_bb successor. * gcc.c-torture/compile/pr108596.c: New test. (cherry picked from commit 603a6fbcaac1e80aa90d1d26318c881a53473066)=