From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 819463858D33; Thu, 4 May 2023 22:59:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 819463858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683241163; bh=7urDS3jUOraz2g4iEOlMVdmGlYf8a6hE0uv5k6U586w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=A57huJkXUFiPm/NK9sqndtjeKvcD4Zp2AvhaSP5Y3bbGg/ZIFUb1TWdrdrciikEa5 zIYD2BcM644KHWvAluCrH+jwLd9a4YopvcKPIj8Grb/NE5B93u4UnSNQ19NZjRMNgL s2wU9ScAfrQFaW81QxrV1223cEijtMj+fZuRwaZU= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109732] [14 regression] gcc miscompiles iterator comparison on nlohmann_json since r14-204-gf1f5cbaa3f716f Date: Thu, 04 May 2023 22:59:22 +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: patch, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia 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=3D109732 --- Comment #14 from Andrew Pinski --- Figured out a C testcase: ``` [[gnu::noipa]] _Bool f3(_Bool a) { if (a=3D=3D0) return 0; else return a; } ``` Still need: `-fdisable-tree-fre1` though because fre is able to figure out = that the return value is always a. We don't need to disable ethread any more sin= ce cfgcleanup will not remove the forwarding BB as it has a predict statement = in it. There are actually two conditions that need to happen to get the wrong code. First is the order of the phi and then also the order of the edges. The abo= ve is enough to get both.=