From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4D7303858422; Thu, 22 Feb 2024 09:06:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D7303858422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708592813; bh=4knCWUSBpj8/CVbtkazKxuwow7rcfGnKvO7WIxLKCuo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hZBfMHfoLtfTPseksj8sErDGrcSwQVh/s83OBiOaKzvJLa63g1xljuKAh7S9flJQ6 DufXiRcjEADq+qjXIygqVdMtB3EWnNJki/0mKQbla00zAnti7DLZcqlRAAqs41HPgp 2lU/1on0d4b2BcYEXmJ4dgpOUtzTFv+oBToUexiE= From: "rdapp at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114027] [14] RISC-V vector: miscompile at -O3 Date: Thu, 22 Feb 2024 09:06:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rdapp 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: 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 #9 from Robin Dapp --- Argh, I actually just did a gcc -O3 -march=3Dnative pr114027.c -fno-vect-cost-model on cfarm188 with a recent-ish GCC but realized that I = used my slightly modified version and not the original test case. long a; int b[10][8] =3D {{}, {}, {}, {}, {}, {}, {0, 0, 0, 0, 0, 1, 1}, {1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1}}; int c; int main() { int d; c =3D 0xFFFFFFFF; for (; a < 6; a++) { d =3D 0; for (; d < 6; d++) { c ^=3D -3L; if (b[a + 3][d]) continue; c =3D 0; } } if (c =3D=3D -3) { return 0; } else { return 1; } } This was from an initial attempt to minimize it further but I didn't really verify if I'm breaking the test case by that (or causing undefined behavior= ). With that I get a "1" with default options and "0" with -fno-tree-vectorize. Maybe my snippet is broken then?=