From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CC3A33B2C74C; Fri, 7 Jul 2023 11:19:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC3A33B2C74C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688728793; bh=GBcIwKemZVIow4W7RdOCesj997XaguhNsXygrVhqqY0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Z6M6vzVdcYIObROhbONOG8zRe/TcM1OeoJKD5p887qg/yKHpiaNMRYRN8MFTJetzG xsEeBvEU2vqj8kFTTmFCooZCUyyj4yzVFjR3et4ew2WgUBxiwAoX9/3p6oId/2Exwe rPIqpCGceZ5dX4gTGJArHDB1wyv7J9LtKSsigW24= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110582] [14 Regression] Wrong code at -O2/3 on x86_64-linux-gnu Date: Fri, 07 Jul 2023 11:19:52 +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: needs-bisection, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: priority cc 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=3D110582 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P1 CC| |amacleod at redhat dot com --- Comment #2 from Richard Biener --- It works with -fno-tree-loop-optimize but the difference from loop opts is = just int main () { int D.2782; int b_lsm.13; int a_lsm.12; char c; - unsigned char c.6_2; - unsigned char _3; int iftmp.1_11; int _12(D); int iftmp.1_15; + unsigned char ivtmp_36; + unsigned char ivtmp_37; int _38; long int _39; long int _40; @@ -23,8 +21,8 @@ [local count: 10737416]: [local count: 1063004409]: - # c_21 =3D PHI # a_lsm.12_4 =3D PHI + # ivtmp_37 =3D PHI if (a_lsm.12_4 !=3D 0) goto ; [50.00%] else @@ -35,10 +33,8 @@ [local count: 1063004409]: # iftmp.1_11 =3D PHI - c.6_2 =3D (unsigned char) c_21; - _3 =3D c.6_2 + 1; - c_18 =3D (char) _3; - if (c_18 !=3D -3) + ivtmp_36 =3D ivtmp_37 - 1; + if (ivtmp_36 !=3D 0) goto ; [98.99%] else with that indeed threadfull2 miscompiles this somehow. Andrew?=