From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CA14E385B51F; Mon, 3 Apr 2023 08:57:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA14E385B51F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680512269; bh=3Rt5rWOxLU4EFUVq/I0YPXiixSDJuycANtZhuFBmRMU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=o4kaQFwr5xTYXokr/Mf4vy8VeBeVyUZdMT/2RjOC/AEnhbUHSWJl2ZbzmuRf+uWu3 gan1AfyXIkl10neGp4OvQCDnTkYuK29EShxBqhdMtp+NcnUosXEvMK+fjgHuaXzfm2 tFTNFESS82eLnL5/JgCLwR1aotf77FzVl/SAM5Og= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/108508] [12 Regression] ICE in insert_def_after, at rtl-ssa/accesses.cc:622 since r12-4759-g95bb87b2458bfa Date: Mon, 03 Apr 2023 08:57:49 +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 X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rsandifo at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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=3D108508 --- Comment #5 from CVS Commits --- The releases/gcc-12 branch has been updated by Richard Sandiford : https://gcc.gnu.org/g:44ca5bc6800987e56db3e5537079b10ad5faac88 commit r12-9379-g44ca5bc6800987e56db3e5537079b10ad5faac88 Author: Richard Sandiford Date: Mon Apr 3 09:57:06 2023 +0100 rtl-ssa: Fix splitting of clobber groups [PR108508] Since rtl-ssa isn't a real/native SSA representation, it has to honour the constraints of the underlying rtl representation. Part of this involves maintaining an rpo list of definitions for each rtl register, backed by a splay tree where necessary for quick lookup/insertion. However, clobbers of a register don't act as barriers to other clobbers of a register. E.g. it's possible to move one flag-clobbering instruction across an arbitrary number of other flag-clobbering instructions. In order to allow passes to do that without quadratic complexity, the splay tree groups all consecutive clobbers into groups, with only the group being entered into the splay tree. These groups in turn have an internal splay tree of clobbers where necessary. This means that, if we insert a new definition and use into the middle of a sea of clobbers, we need to split the clobber group into two groups. This was quite a difficult condition to trigger during development, and the PR shows that the code to handle it had (at least) two bugs. First, the process involves searching the clobber tree for the split point. This search can give either the previous clobber (which will belong to the first of the split groups) or the next clobber (which will belong to the second of the split groups). The code for the former case handled the split correctly but the code for the latter case didn't. Second, I'd forgotten to add the second clobber group to the main splay tree. :-( gcc/ PR rtl-optimization/108508 * rtl-ssa/accesses.cc (function_info::split_clobber_group): When the splay tree search gives the first clobber in the second gro= up, make sure that the root of the first clobber group is updated correctly. Enter the new clobber group into the definition spl= ay tree. gcc/testsuite/ PR rtl-optimization/108508 * gcc.target/aarch64/pr108508.c: New test. (cherry picked from commit f4e1b46618ef3bd7933992ab79f663ab9112bb80)=