From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 94EB23858D20; Tue, 5 Mar 2024 14:14:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 94EB23858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709648090; bh=tVtwYimTwIunCyNIO2EAywsg/HR5QFv8bFfjbf76Ups=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rI2GQeweA2JJZrb7NXHSA6yqwTN8TAGHWs9Hi4ZvKVil/H0oobl1ARa3VPz5WZUGZ eKG5a/lv8RLcng/7l1jw8m9njTfABVhioA1q97b3Be5aJI2yqofjUUDdsMJFepFRnt Gqyiu6jLpQ/jRWEi8RqtzbDIgpst6o0+jaqukcwo= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114009] [11/12/13/14 Regression] Missed optimization: (!a) * a => 0 when a=(a/2)*2 Date: Tue, 05 Mar 2024 14:14:50 +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: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 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=3D114009 --- Comment #3 from Jakub Jelinek --- That said, I fail to see why the a/2*2 in there matters. a*!a is simply always 0 for integral types, both signed and unsigned, inclu= ding signed 1-bit precision. If a is 0, the result is 0*1 (or for the last one 0*-1), if a is non-zero, then the result is a*0.=