From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3D02A3858C3A; Wed, 15 Feb 2023 18:29:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D02A3858C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676485784; bh=PJT3nzbXEeVxEDHZRuQ6txd5yI8bIjNJ0WmKsWF9d30=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qrIQYmHUp7Km6fBZKmck+Wmo2g0hK8Uv1ER+X8OWR/tDSJZOe1bH6jJhdfK4sa4Z9 guASAgqQ3fwk38hGX0cxD1k9Mg/0PvGQuDJPU6o9gEkY3+m7iL3mF6B1cEsjf34z9y OV2il2gZxjXN21+YDzrHfHTbSwCFzp66XcMA0u6c= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/108657] [13 Regression] csmith: possible wrong checksum with -O3 and -ftrivial-auto-var-init=zero Date: Wed, 15 Feb 2023 18:29:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: needs-reduction, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 13.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108657 --- Comment #16 from Jakub Jelinek --- Slightly more reduced: int a =3D -8, c, e, f, g, i; short b; static int *d =3D &c; int m[256]; unsigned n =3D ~0U; void foo (int b) { n =3D (n >> 8) ^ m[(n ^ b) & 255]; } void bar (long x) { n =3D (n >> 8) ^ m[(n ^ x) & 255]; foo (x >> 8); foo (x >> 16); } int main () { if (__CHAR_BIT__ !=3D 8 || __SIZEOF_SHORT__ !=3D 2 || __SIZEOF_INT__ !=3D= 4) return 0; for (g =3D 0; g < 256; g++) m[g] =3D g; b =3D 53935 & a; a =3D -18; for (c =3D 1; c >=3D 0; c--) { e =3D 0; for (int j =3D 0; j <=3D 3; j++) { short k[1]; if (e) break; e ^=3D f; } } *d =3D 8 || 0; bar (a); bar (b); bar (2185655400); bar (c); if (n !=3D 0x30) __builtin_abort (); }=