From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 328F23858C60; Sat, 16 Oct 2021 18:46:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 328F23858C60 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102798] [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta by r9-2475 Date: Sat, 16 Oct 2021 18:46:21 +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: alias, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: short_desc 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: Sat, 16 Oct 2021 18:46:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102798 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|[9/10/11/12 Regression] |[9/10/11/12 Regression] |wrong code with -O3 |wrong code with -O3 |-fno-tree-pta -mavx512f by |-fno-tree-pta by r9-2475 |r9-2475 | --- Comment #5 from Andrew Pinski --- Here is a testcase which fails without -mavx512 typedef __SIZE_TYPE__ size_t; __attribute__((__noipa__)) void BUF_reverse (unsigned char *out, const unsigned char *in, size_t size) { size_t i; if (in) { out +=3D size - 1; for (i =3D 0; i < size; i++) *out++ =3D *in++; } else { unsigned char *q; char c; q =3D out + size - 1; for (i =3D 0; i < size ; i++) { *out++ =3D 1; } } } int main (void) { unsigned char buf[40]; unsigned char buf1[40]; for (unsigned i =3D 0; i < sizeof (buf); i++) buf[i] =3D i; BUF_reverse (buf, 0, sizeof (buf)); for (unsigned i =3D 0; i < sizeof (buf); i++) if (buf[i] !=3D 1) __builtin_abort (); return 0; }=