From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 66520385841A; Tue, 25 Jul 2023 06:34:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66520385841A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690266841; bh=61ZNrisg6c/PWfuJqUWiinWqKBPz3gZixwDhRvZw3zI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=guItjlapeqS31WRegl5aEJoELvdzztNZ6VaVd/uS5C1N9AoIobm3f0LWIQEiRFVjD yI2wd0XPp+hKZEGWkJJDq7o+IKvXO77iYmgL5yLq3o7bP5D7P2RQ/sj7A+QyVdbBkT h5yuEAGZYimTht3PtDt6hOUXOBFkuWUVN7A+gRJU= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110776] [14 Regression] powerpc-darwin bootstrap broken after r14-2490 with ICE rs6000.cc:5069 building libgfortran Date: Tue, 25 Jul 2023 06:34:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: build, ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: linkw at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.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=3D110776 --- Comment #5 from rguenther at suse dot de --- On Tue, 25 Jul 2023, linkw at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110776 >=20 > Kewen Lin changed: >=20 > What |Removed |Added > -------------------------------------------------------------------------= --- > CC| |rguenth at gcc dot gnu.o= rg >=20 > --- Comment #3 from Kewen Lin --- > The failure exposed one special case: there is one stmt=20 >=20 > # VUSE <.MEM_404> > _15 =3D *_14; >=20 > its STMT_VINFO_STRIDED_P (stmt_info) is set, memory_access_type is > VMAT_ELEMENTWISE and alignment_support_scheme is dr_unaligned_supported, = its > vector type is "vector(1) long int", so in the handling it's taken as: >=20 > /* Load vector(1) scalar_type if it's 1 element-wise vectype. */ > else if (nloads =3D=3D 1) > ltype =3D vectype; >=20 > as its ltype is vector type, we cost it with=20 >=20 > if (VECTOR_TYPE_P (ltype)) > vect_get_load_cost (vinfo, stmt_info, 1, > alignment_support_scheme, misalig= nment, > false, &inside_cost, nullptr, cos= t_vec, > cost_vec, true); >=20 > as it's dr_unaligned_supported, it's costed as unaligned_load then causes= the > ICE. One idea is to teach rs6000_builtin_vectorization_cost about one sin= gle > lane vector unaligned load as scalar_load. But I think it's simple to tre= at > single lane vector load as scalar_load, as I expect veclower will lower it > later. >=20 > diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc > index 4622d6a04ef..bdf4c12cd03 100644 > --- a/gcc/tree-vect-stmts.cc > +++ b/gcc/tree-vect-stmts.cc > @@ -9985,7 +9985,9 @@ vectorizable_load (vec_info *vinfo, > { > if (costing_p) > { > - if (VECTOR_TYPE_P (ltype)) > + /* For a single lane vector type, we should cost it as > + scalar_load to avoid ICE, see PR110776. */ > + if (VECTOR_TYPE_P (ltype) && lnel > 1) > vect_get_load_cost (vinfo, stmt_info, 1, > alignment_support_scheme, > misalignment, > false, &inside_cost, nullptr, > cost_vec, >=20 > Hi Richi, what do you think of this? I think apart from the consideration what a single element vector is compared to a scalar, a more to-the-point fix is if (VECTOR_TYPE_P (ltype) && memory_access_type !=3D VMAT_ELEMENTWISE)=