From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F40713858011; Tue, 6 Sep 2022 08:01:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F40713858011 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662451293; bh=hg+W/OlTO0QR6x6b7DHJr65og6nWVjNhInJpLDNkJv8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZHwDbPgCksNBvPFV8GB8PwYqrI4nDqIf7mHvIcdKxcixbiK1B5MiU5OxmY2owPfZ+ uurSvmnbaCkdl7kPOn6Q+6HbjtcR73jT9Ur6U46FkAa8k00vWy8LwygzAlDLg45XkL HeW1Z51Bx1uKfxqfp8QZ395b/Nz/PpC0NeJmdHhQ= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106841] [12/13 Regression] ICE in vect_get_vec_defs_for_operand, at tree-vect-stmts.cc:1509 since r12-2733-g31855ba6b16cd138 Date: Tue, 06 Sep 2022 08:01:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ 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.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to bug_status 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=3D106841 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot = gnu.org Status|NEW |ASSIGNED --- Comment #4 from Richard Biener --- The issue seems to be that we get t.ii:40:17: note: vect_recog_widen_mult_pattern: detected: _56 =3D _55 * = 8; t.ii:40:17: note: widen_mult pattern recognized: patt_36 =3D (long unsign= ed int) patt_38; t.ii:40:17: note: extra pattern stmt: patt_38 =3D _76 w* 8; ... t.ii:40:17: note: ------>vectorizing statement: _55 =3D (long unsigned int= ) _76; t.ii:40:17: note: ------>vectorizing statement: patt_63 =3D _76 w* 8; t.ii:40:17: note: transform statement. ... t.ii:40:17: note: ------>vectorizing statement: A$z_42 =3D MEM[(const stru= ct R3 &)_57].z; t.ii:40:17: note: multiple-types. t.ii:40:17: note: transform statement. t.ii:40:17: note: vect_is_simple_use: operand (long unsigned int) _76, typ= e of def: internal t.ii:40:17: note: vect_is_simple_use: vectype vector(2) long unsigned int t.ii:40:17: note: transform load. ncopies =3D 2 t.ii:40:17: note: vect_get_vec_defs_for_operand: _55 and a SLP tree that seems to run into a bug with hybrid discovery: t.ii:40:17: note: node 0x654a7d8 (max_nunits=3D4, refcnt=3D2) vector(4) i= nt t.ii:40:17: note: op template: _76 =3D (int) _75; t.ii:40:17: note: stmt 0 _76 =3D (int) _75; t.ii:40:17: note: stmt 1 _84 =3D (int) _83; t.ii:40:17: note: children 0x654a860 t.ii:40:17: note: Processing hybrid candidate : _55 =3D (long unsigned in= t) _76; t.ii:40:17: note: Marked SLP consumed stmt pure: _55 =3D (long unsigned i= nt) _76; that is because the use of _55 is _56 =3D _55 * 8; but that is part of a pattern that is PURE_SLP and we fail to see the direct use in the gather since gather discovery skips this scaling stmt. We can probably detect this after the fact but the best fix would be to somehow mark _55 as hybrid, I'll see if I can manage to do that.=