From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0F020385AC33; Wed, 30 Jun 2021 11:30:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F020385AC33 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/101267] [12 Regression] ICE in vect_is_simple_use when building 521.wrf_r with -Ofast -march=znver2 Date: Wed, 30 Jun 2021 11:30:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.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 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, 30 Jun 2021 11:30:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101267 --- Comment #6 from Richard Biener --- (In reply to rsandifo@gcc.gnu.org from comment #5) > (In reply to Richard Biener from comment #4) > > So we're having > >=20 > > (gdb) p debug (slp_node) > > t.f90:1:21: note: node 0x39fbbc0 (max_nunits=3D2, refcnt=3D1) > > t.f90:1:21: note: op template: _144 =3D .MASK_LOAD (_143, 32B, _142); > > t.f90:1:21: note: stmt 0 _144 =3D .MASK_LOAD (_143, 32B, _142); > > t.f90:1:21: note: stmt 1 _146 =3D .MASK_LOAD (_145, 32B, _142); > > t.f90:1:21: note: children 0x39fbc48 > >=20 > > where vectorizable_load invokes > >=20 > > 8500 if (!vect_check_scalar_mask (vinfo, stmt_info, mask, > > &mask_dt, > > 8501 &mask_vectype)) > > 8502 return false; > >=20 > > but the SLP child is > >=20 > > (gdb) p debug ((slp_tree)0x39fbc48) > > t.f90:1:21: note: node (external) 0x39fbc48 (max_nunits=3D1, refcnt=3D1) > > t.f90:1:21: note: { _142, _142 } > >=20 > > so it won't have a vector type set. In fact vect_check_scalar_mask doe= sn't > > seem to be prepared for SLP at all - we're lucky it "works" but then mo= st > > definitely it won't for externals. You'll note that the SLP variant for > > vect_is_simple_use won't be applicable here since we only have SLP > > representations for the mask operand which isn't even the first one. > Seems like we should have a way of representing this kind of situation > though. It doesn't seem unreasonable to have some operands (and especial= ly > call arguments) that don't need to be vectorised. >=20 > Maybe a =E2=80=9Cfix=E2=80=9D for now might be to pass separate SLP and n= on-SLP operand > numbers to vect_is_simple_use. Yes, I'm doing that for the single localized place where it should matter n= ow, see the patch posted. There's always the possibility to fill SLP operands with NULL (as we do for PHIs in some cases). But then we do likely expect the "missing" operands to be code-generated.=