From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 03A743857BA6; Fri, 7 Oct 2022 21:04:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03A743857BA6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665176641; bh=QCFSd2vJ1tEsB73YhSG9WViuZQQ77jPejCUx2VpdiVY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AVboQB2tdVG4vq4KRgeKKjOv/fwwx4tUGYnULqzv2a+Y5QNSW1bwXm/bbYvhM8aO5 lM57MUMkYHvUu4Qn1d37rjv4PxO6T/nOrqC5nIOIdGtgfFNooAkGPQiyEfeA+iWDdt p0Zv2MchS87IH481bQweztk1yf/o1Cz7z3uZi4Xs= 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: Fri, 07 Oct 2022 21:04:00 +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: 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=3D107172 H.J. Lu changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hjl.tools at gmail dot com, | |ubizjak at gmail dot com --- Comment #4 from H.J. Lu --- There are: (insn 6 5 17 2 (set (reg:SI 87 [ a_lsm.8 ]) (const_int 2 [0x2])) "x.c":7:7 83 {*movsi_internal} (nil)) ... (insn 62 59 63 2 (parallel [ (set (reg:CCC 17 flags) (ne:CCC (reg:SI 87 [ a_lsm.8 ]) (const_int 0 [0]))) (set (reg:SI 96)=20 (neg:SI (reg:SI 87 [ a_lsm.8 ]))) ]) "x.c":4:7 680 {*negsi_ccc_1} (expr_list:REG_DEAD (reg:SI 87 [ a_lsm.8 ]) (expr_list:REG_UNUSED (reg:SI 96)=20 (nil)))) (insn 63 62 64 2 (parallel [ (set (reg:SI 97)=20 (neg:SI (ltu:SI (reg:CCC 17 flags) (const_int 0 [0])))) (clobber (reg:CC 17 flags)) ]) "x.c":4:7 1258 {*x86_movsicc_0_m1_neg} (expr_list:REG_DEAD (reg:CCC 17 flags) (expr_list:REG_UNUSED (reg:CC 17 flags) (nil)))) Since r87 =3D=3D 2, combine knows (reg:CCC 17 flags) =3D=3D 1 and optimizes (ltu:SI (reg:CCC 17 flags) (const_int 0 [0])) as (ltu:SI (const_int 1 [1]) (const_int 0 [0])) to 0.=