From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2C6383858020; Thu, 28 Sep 2023 15:19:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C6383858020 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695914348; bh=bn3SiPm3i3GDh8B/LTFBp+W+Nrvnboc1pecKDr0Latw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mYSA+W2K6PsMIGDdOT2LPMnr60qJmKnZBI6W1RXz8gVhez3ax+aoQa6l0Qi/wk/Ta huC2IF1MZYuxwBXcYDIQS4Pte9FVRn+UNtRytBvVndNCZVbKmc4PFtLuYMc85pfTkq 0bGFnkKr6G8rt6F+Kr/R7/Jlv5MmIUJWhRqw2C3A= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111631] [14 Regression] Wrong code at -Os on x86_64-linux-gnu since r14-3217-g4d6132e5932 Date: Thu, 28 Sep 2023 15:19:07 +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: RESOLVED X-Bugzilla-Resolution: DUPLICATE X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.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=3D111631 --- Comment #2 from Andrew Pinski --- ldist produces: b_25 =3D (long int) j_23; d_26 =3D h; _8 =3D (sizetype) d_26; _38 =3D (char *) b_25; __builtin_memset (_38, 0, _8); and also we have: [local count: 13370358]: if (j_23 !=3D 0) goto ; [50.00%] else goto ; [50.00%] ... [local count: 6685179]: g.10_9 =3D g; _10 =3D *g.10_9; _11 =3D (unsigned short) _10; _12 =3D _11 + 65535; _13 =3D (short int) _12; *g.10_9 =3D _13; But since d_26 is 0, originally there was no deferencing of _38 but now the= re is and such.=