From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ED2223858C27; Wed, 9 Dec 2020 14:23:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED2223858C27 From: "rsandifo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c Date: Wed, 09 Dec 2020 14:23:01 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rsandifo at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: akrl at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 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 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: Wed, 09 Dec 2020 14:23:02 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97092 --- Comment #4 from rsandifo at gcc dot gnu.org --- (In reply to Andrea Corallo from comment #3) > Created attachment 49710 [details] > PR97092.patch >=20 > What is going on is that in 'update_costs_from_allocno' we try to > identify the smallest mode using narrower_subreg_mode to then update the > costs. >=20 > The two modes involved here are E_DImode and E_VNx2QImode, cause these > are not ordered we ICE in 'paradoxical_subreg_p'. >=20 > Now I don't know if the strategy we want is: >=20 > - In 'update_costs_from_allocno' when modes are not ordered instead of > calling 'narrower_subreg_mode' just keep the current one. >=20 > - Always select the cheapest mode in terms of cost. >=20 > The attached I'm testing implements the second. I think instead we should consider recomputing =E2=80=9Cmode=E2=80=9D in ea= ch iteration of the loop, rather than carry over the result of previous iterations. I.e. use: mode =3D narrower_subreg_mode (ALLOCNO_MODE (cp->first), ALLOCNO_MODE (cp->second)); instead of: mode =3D narrower_subreg_mode (mode, ALLOCNO_MODE (cp->second)); Before g:e2323a2b77c91d1ba8194b01e6deaa2e00f15990 =E2=80=9Cmode=E2=80=9D was a loop invariant, so it made sense to set it outside the loop. I think the intention of that patch was to use the smaller of the two modes involved in the copy, and carrying the result over to future copies might have been unintentional. The difficulty with carrying the mode over to later copies is that the costs then become dependent on the order of the copies, whereas I'm not sure the order of the copies is significant.=