From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2E41B3858C66; Tue, 25 Jul 2023 02:52:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E41B3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690253531; bh=eU8zH6NHoigoNVxWxhre0uao0f0CEnFrV62ORdoYYL4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=s6xl04I7XwBjpZ2rAe0dmGFb6xuS01Y+fOz+F6tHadV4eZH5aNFAZbSXRHfGFkzsT dvr56YUZI0XD6waoBZpZSG2Xbpjl9wP8ezDcAANtBgE3A16as5tFfS/vLycUiA2p+S bIUx7j5gncXicmwfIDJxBAvfn0LV17DHYBOe9SRg= From: "linkw at gcc dot gnu.org" 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 02:52:08 +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: linkw at gcc dot gnu.org 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: 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=3D110776 Kewen Lin changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org --- Comment #3 from Kewen Lin --- The failure exposed one special case: there is one stmt=20 # VUSE <.MEM_404> _15 =3D *_14; 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: /* Load vector(1) scalar_type if it's 1 element-wise vectype. */ else if (nloads =3D=3D 1) ltype =3D vectype; as its ltype is vector type, we cost it with=20 if (VECTOR_TYPE_P (ltype)) vect_get_load_cost (vinfo, stmt_info, 1, alignment_support_scheme, misalignm= ent, false, &inside_cost, nullptr, cost_= vec, cost_vec, true); as it's dr_unaligned_supported, it's costed as unaligned_load then causes t= he ICE. One idea is to teach rs6000_builtin_vectorization_cost about one single lane vector unaligned load as scalar_load. But I think it's simple to treat single lane vector load as scalar_load, as I expect veclower will lower it later. 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, Hi Richi, what do you think of this?=