From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E76E7385840C; Wed, 27 Apr 2022 11:56:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E76E7385840C From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/105219] [12 Regression] SVE: Wrong code with -O3 -msve-vector-bits=128 -mtune=thunderx Date: Wed, 27 Apr 2022 11:56:24 +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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: avieira 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, 27 Apr 2022 11:56:25 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105219 --- Comment #13 from Martin Li=C5=A1ka --- (In reply to Richard Biener from comment #11) > int data[128]; >=20 > void __attribute((noipa)) > foo (int *data, int n) > { > for (int i =3D 0; i < n; ++i) > data[i] =3D i; > } >=20 > int main() > { > for (int start =3D 0; start < 16; ++start) > for (int n =3D 1; n < 3*16; ++n) > { > __builtin_memset (data, 0, sizeof (data)); > foo (&data[start], n); > for (int j =3D 0; j < n; ++j) > if (data[start + j] !=3D j) > __builtin_abort (); > } > return 0; > } >=20 > for example aborts with -O3 -mtune=3Dintel -fno-vect-cost-model on x86_64, > the cost model disabling is necessary to have the epilogue vectorized. > Without a cost model we peel for the maximum number of aligned refs > but still use the target cost to decide whether peeling is worth at all. This one started with r12-1181-g7ed1cd9665d8ca0f.=