From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EFBF33858291; Mon, 17 Oct 2022 15:59:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EFBF33858291 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666022358; bh=h7ZI8B7lMJAepScXJQEB7/DQS0P6bONhIrHJ9OBZS9k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AivDXqshQzCa1SY+kDQoMG7GeEduGpeYpFSCr81Wr+tJI2eN/85GMByMdXCwga3K3 2vsXda3WActPZ/9mUnQVLmhErmaCcyOY2IGYid7U2FEgALKuqExLxvpYS7kXH1DhqZ JlYUSapSyHfV5CXiWItAhPNq4xnZR/CPDEjTd8+s= From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/107172] [13 Regression] wrong code with "-O1 -ftree-vrp" on x86_64-linux-gnu since r13-1268-g8c99e307b20c502e Date: Mon, 17 Oct 2022 15:59:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com 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: 13.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=3D107172 --- Comment #37 from H.J. Lu --- (In reply to Segher Boessenkool from comment #33) > (In reply to H.J. Lu from comment #32) > > > There is no actual comparison with 0, that is just notation. > >=20 > > True. But simplify-rtx.cc simplifies > >=20 > > (ltu (reg 17) (const_int 0)) > >=20 > > to false when reg 17 is set. >=20 > Is set? What does that even mean? Is set to what? (reg 17) was set to 1. > > Use the actual comparison isn't issue. The issue is how > >=20 > > (ltu (reg 17) (const_int 0)) > >=20 > > should be simplified when reg 17 is known to be set. >=20 > You need to look at the setter. It cannot be simplified otherwise. The backend knows how to evaluate (ltu:SI (const_int 1 [0x1]) (const_int 0 [0])) from (ltu:SI (reg:CCC 17 flags) (const_int 0 [0])) where (reg:CCC 17 flags) was set to a constant by backend.=