From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3DF993858C60; Wed, 26 Apr 2023 21:03:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3DF993858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682543034; bh=dlba0PFtmdhu91MnwQ1bMIeL46mty51lQe9pHBrqUZY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Iyl7JJsi4wVFKnFTtAY/We2o3nW72aAcXk2jz5N4lYLSVJIkKCL71mU8c38+DdSdm sQxeOM8vwmSON+Y4pqo7lhanf129uqaB27wB5kNma0dcBz1+F/ABkMXetljW9xdQ9A hP+c3MrmFgo89LOfKWJc5bI0Y515g7CRXN0kdskM= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109638] unsigned > 1 ? 0 : n is not optimized to n == 1 Date: Wed, 26 Apr 2023 21:03:54 +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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D109638 --- Comment #1 from Andrew Pinski --- This should do it, I think: (simplify (cond (lt @1 integer_onep@2) integer_zerop @1) (if (TYPE_UNSIGNED (type)) (convert (eq @1 @2))))=