From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5780F3858288; Thu, 13 Oct 2022 22:20:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5780F3858288 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665699655; bh=sejYGvmwZm94mvQfn/pI9bFb0azzeXVkNbAb7rhCFoY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QCVXbGI/Oo+gcCeh8ZaCvYXQVbNqqw4ZnOLwtwc69nGlHShwrNb0jlB11XsACnpiU P21K9rCGBXf90M2umxu1OdXM8cbBtdLdeMrHtxB2OWdCVa0oy873C6ws01em6c5lEw QVJdU80wYARjlscyEbBALdvJLSkFolcm/YDiZI78= From: "segher at gcc dot gnu.org" 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: Thu, 13 Oct 2022 22:20:54 +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: segher 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: 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 #30 from Segher Boessenkool --- (In reply to H.J. Lu from comment #26) > LTU/GEU are only used to check FLAGS_REG against constant 0. That is not what (ltu (reg 17) (const_int 0)) means though? Together with a previous (set (reg 17) (compare A B)) it means the result of A <=3D B. There is no actual comparison with 0, that is just notation. > simplify_const_relational_operation has >=20 > /* We can't simplify MODE_CC values since we don't know what the > actual comparison is. */ > if (GET_MODE_CLASS (GET_MODE (op0)) =3D=3D MODE_CC) > return 0; And combine *does* know how to find the actual comparison, in many cases. = Some other passes can as well, there is no magic involved, you just need to look= at other insns as well (just one really, the CC setter).=