From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 98A1C3858400; Tue, 28 Sep 2021 04:37:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98A1C3858400 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102511] [12 Regression] GCC produces incorrect code for -O3: first element of the array is skipped Date: Tue, 28 Sep 2021 04:37:04 +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: 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: 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: Tue, 28 Sep 2021 04:37:04 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102511 --- Comment #3 from Andrew Pinski --- Here is one which aborts and shows the issue: char arr_15 [8]; __attribute__((noipa)) void test(signed char a, unsigned short b, unsigned long long c, unsigned short f) { for (int d =3D b - 8; d < b; d +=3D 2) for (short e =3D 0; e < (unsigned short)((f ? 122 : 0) ^ (a ? c : 0)) - 64055; e +=3D 3) arr_15[d] =3D 42; } int main() { test(37, 8, 12325048486467861044ULL, 45936); for (int i =3D 0; i < 8; ++i) { if (arr_15[i] !=3D ((i&1) ? 0 : 42)) __builtin_abort(); } return 0; }=