From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 27B363860C3F; Tue, 1 Dec 2020 08:33:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 27B363860C3F From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/98069] [8/9/10/11 Regression] Miscompilation with -O3 since r8-2380-g2d7744d4ef93bfff Date: Tue, 01 Dec 2020 08:33:00 +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: 11.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: 8.5 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, 01 Dec 2020 08:33:01 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98069 --- Comment #2 from Richard Biener --- The following fails with -O2 -ftree-vectorize long long int var_3 =3D -166416893043554447LL; short var_8 =3D (short)27092; unsigned int var_17 =3D 75036300U; short arr_165[23]; static long c(long e, long f) { return f ? e : f; } void __attribute((noipa)) test() { for (int b =3D 0; b < 19; b =3D var_17) for (int d =3D (int)(~c(-2147483647 - 1, var_3)) - 2147483647; d < 22; = d++) arr_165[d] =3D var_8; } int main() { for (unsigned i_3 =3D 0; i_3 < 23; ++i_3) arr_165[i_3] =3D (short)-8885; test(); if (arr_165[0] !=3D 27092) __builtin_abort (); return 0; }=