From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E57233858D34; Thu, 22 Feb 2024 09:48:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E57233858D34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708595328; bh=6apMFqH/jNKErDbS3Z6/vj4zH9hYT1B+gwDFfS0adO8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Kq478HoTG28zj9hfCuL7Ck77HCt3AQqyJBMWbqhoLvOfrnHt80bBvasuiX0/CtL0W q2s+fUBv57KTSyM1V65RfgdwBv+PDGuRNQoVhE132NbHjA2Dd1m4zT8aqtMMI030bf fFWeS7AVyKXIxIzfluOF5YKk1Vdgw8MsPgEZzFRw= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114027] [11/12/13/14 Regression] miscompile at `-O3 -fno-vect-cost-model -msse4.2` Date: Thu, 22 Feb 2024 09:48:48 +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: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114027 --- Comment #14 from Richard Biener --- int __attribute__((noipa)) foo (int *f, int n) { int res =3D 0; for (int i =3D 0; i < n; ++i) { if (f[2*i]) res =3D 2; if (f[2*i+1]) res =3D -2; } return res; } int f[] =3D { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 }; int main () { if (foo (f, 16) !=3D 2) __builtin_abort (); return 0; }=