From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 872B13858D35; Mon, 8 May 2023 19:30:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 872B13858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683574238; bh=7iZehTxsH6SfjO9cxtgN6Zvt97l9Mr7IWy8R1WWktmY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CpWKOalf5BJqrCf0qC9zHNL5deWwQTLXLNK7mwPWkkHKoKFXQpiDljYqk7+F8Kwmg z14cbfWT5coWYT/YGuMFjqEr0wP+2ibPXZFbY9roX/oyYZeEkfciYLcXNNK3x6CLSf FrlOLhFIdYIhATIAZ+RfUtuEE+J4jwLJipYISCiA= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109778] [12/13/14 Regression] Wrong code at -O1 and above on x86_64-linux-gnu since GCC-12.2 Date: Mon, 08 May 2023 19:30:38 +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: pinskia 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on everconfirmed keywords component bug_status short_desc 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=3D109778 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-05-08 Ever confirmed|0 |1 Keywords| |wrong-code Component|c |tree-optimization Status|UNCONFIRMED |NEW Summary|Wrong code at -O3 on |[12/13/14 Regression] Wrong |x86_64-linux-gnu since |code at -O1 and above on |GCC-12.2 |x86_64-linux-gnu since | |GCC-12.2 --- Comment #1 from Andrew Pinski --- ccp2: Visiting statement: _16 =3D (unsigned intD.9) g_15; which is likely CONSTANT Lattice value changed to CONSTANT 0xdb (0x20). Adding SSA edges to worklis= t. marking stmt to be not simulated again Visiting statement: _17 =3D _16 + 4294967210; which is likely CONSTANT Lattice value changed to CONSTANT 0x85 (0x20). Adding SSA edges to worklis= t. marking stmt to be not simulated again Visiting statement: _18 =3D _17 <=3D 7; which is likely CONSTANT Lattice value changed to CONSTANT 0. Adding SSA edges to worklist. marking stmt to be not simulated again Note this is with -O1 with: ``` int printf(const char *, ...); int a, b, c, d; int *e =3D &c; static inline unsigned f(unsigned char g) { g =3D 1 | g << 1; g =3D g >> 4 | g << 4; return g; } static inline void h(unsigned g) { *e =3D 8 > f(g + 86) - 86; } int main() { d =3D a && b; h(d + 4); printf("%d\n", c); } ```=