From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 818723857C48; Wed, 15 Feb 2023 18:43:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 818723857C48 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676486589; bh=nnZcmhzIcOQeaVZmah99TdOdHzaXef35ePYQFmeDX6Q=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WM/4ZiOpuUaOxiqzbrQ7c+PIOSk/hYJny+hR5nLX1GY70Nm6gtL09yjPPFYCUWmC4 g4RM8rDuzWfpMEX7NWuEMu3WOyCXZr/FVw6ZQFomGjTA156WAcX/A8D1xZoROmXSV8 3JA/xlXkN4tA0E3qAtF1Wn9g73MKpfKgqzVM6E5w= 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:43:09 +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: NEW 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: everconfirmed bug_status cf_reconfirmed_on 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 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2023-02-15 --- Comment #17 from Jakub Jelinek --- In the assembly, the important difference is that with just -O3 c is assign= ed 1 before calling the first bar, while -O3 -ftrivial-auto-var-init=3Dzero it is assigned 0. This is visible already in optimized dump, which for the latter stores first c =3D 1; and then twice c =3D 0; among the various DEFERRED_IN= ITs. Even further reduced: int c, e, f; static int *d =3D &c; __attribute__((noipa)) void foo (void) { if (c !=3D 1) __builtin_abort (); } int main () { for (c =3D 1; c >=3D 0; c--) { e =3D 0; for (int j =3D 0; j <=3D 2; j++) { short k[1]; if (e) break; e ^=3D f; } } *d =3D 1; foo (); }=