From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0184D3872574; Mon, 11 Apr 2022 13:29:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0184D3872574 From: "acoplan at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/105219] New: [12 Regression] SVE: Wrong code with -O3 -msve-vector-bits=128 -mtune=thunderx Date: Mon, 11 Apr 2022 13:29:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: acoplan at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Mon, 11 Apr 2022 13:29:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105219 Bug ID: 105219 Summary: [12 Regression] SVE: Wrong code with -O3 -msve-vector-bits=3D128 -mtune=3Dthunderx Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: acoplan at gcc dot gnu.org Target Milestone: --- The following C program appears to be miscompiled with -O3 -march=3Darmv8.2= -a+sve -msve-vector-bits=3D128 -mtune=3Dthunderx : int a; char b[60]; short c[18]; short d[4][19]; long long f; void e(int g, int h, short k[][19]) { for (signed i =3D 0; i < 3; i +=3D 2) for (signed j =3D 1; j < h + 14; j++) { b[i * 14 + j] =3D 1; c[i + j] =3D k[2][j]; a =3D g ? k[i][j] : 0; } } int main() { e(9, 1, d); for (long l =3D 0; l < 6; ++l) for (long m =3D 0; m < 4; ++m) f ^=3D b[l + m * 4]; if (f) __builtin_abort (); } Of course the choice of tuning is not sensible when asking for SVE, but GCC shouldn't produce wrong code in any case. I can't reproduce the problem with GCC 11.=