From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9477A394BE2C; Wed, 20 May 2020 09:32:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9477A394BE2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589967178; bh=cD9KJ1ab5DSlQkRmPmQuMziq9pc+mITWhXc0xRjbJJw=; h=From:To:Subject:Date:From; b=KoHefUHOnxQkiV3hjXop/hRAkqO+hztlibH6rYEMGGzOon/lZAOE+kvGoY10U8kiK KfvNpDy92xENd6O7WBMCgIAkVcs/E9985iypJyxA2wYYzbv9mqda/+K41ZwWUgKc6u IlRQ7QVyd9qy74N8ro7sGq57nn3hQWCBpk8Eye2s= From: "gabravier at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95235] New: Failure to properly optimize out register use in bit-twiddling code Date: Wed, 20 May 2020 09:32:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Wed, 20 May 2020 09:32:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95235 Bug ID: 95235 Summary: Failure to properly optimize out register use in bit-twiddling code Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: gabravier at gmail dot com Target Milestone: --- int f(int a, int b) { return ((a & 1) !=3D 0) !=3D (b !=3D 0); } With -O3, GCC outputs this : f(int, int): test esi, esi setne al xor edi, eax mov eax, edi and eax, 1 ret GCC should be able of outputting this instead : f(int, int): test esi, esi setne al xor eax, edi and eax, 1 ret But it does not do so.=