From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 227AD3857C61; Mon, 10 Aug 2020 00:19:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 227AD3857C61 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597018768; bh=eBjJVAnVu1051sRRV5o1yYm/F03OHHKBiAcwhd8ToMY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ie0h20gP/ccZ30ewgvGpcy4A/fa6x3AH5ZqzxmxN5HnYjxDpHHoKql2YjFWHe6YA2 wd2OBJ0nhzOlLv+vQB+uZVPCSqYkKv65eleUqNNSvxLB7IioeSaKsD2DySHdD4W23a DTPS4tAjcn2h4l5A05ewvxDjC9VPVe2ph9Hbzxbk= From: "gabravier at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/94892] (x >> 31) + 1 not getting narrowed to compare Date: Mon, 10 Aug 2020 00:19:27 +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: 10.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: gabravier at gmail dot com 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2020 00:19:28 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94892 --- Comment #4 from Gabriel Ravier --- Harald, for the specific code you wrote, I now see this from GCC : f(int): test edi, edi js .L2 jmp f1() .L2: jmp f2() So for that specific code, GCC has improved, though for the original test c= ase it has not. I must note, though, that this still means that either : - GCC fails to properly optimize `(x >> 31) + 1` - GCC fails to properly optimize my original test case=