From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5CBF63858D20; Sun, 12 Nov 2023 20:15:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5CBF63858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699820147; bh=ZWDdpIAiHCA92vthEwOwM6lAijHmg1sEsP7CpHlnoKs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uW7GszXOMa6ay1Mq2JKobkiY00ZJ+cj5VZfC4dohkCVNLs/o1xyhVZBL0fRp0cDGT C4HZJqEhajm6YvqJ/0H0FMMCnlSOKpBtoNyhPiTKWvFLcqnF/1n8w15rcCbbHmCQyH qUzomFTH23aNt32Kf/5vIlsn38PCTcskjfT00OOs= From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110790] [14 Regression] gcc -m32 generates invalid bit test code on gmp-6.2.1 Date: Sun, 12 Nov 2023 20:15:46 +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: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.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=3D110790 --- Comment #9 from Uro=C5=A1 Bizjak --- (In reply to Andrew Pinski from comment #8) > I need some code generation help for gcc.target/i386/pr110790-2.c, I have= a > patch where we now generate: > ``` > movq (%rdi,%rax,8), %rax > shrq %cl, %rax > andl $1, %eax > ``` >=20 > instead of previously: > ``` > movq (%rdi,%rax,8), %rax > btq %rsi, %rax > setc %al > movzbl %al, %eax > ``` >=20 > I suspect the sequence that contains shrq/and is better but I am 100% sur= e. > We still get btq when used with a conditional too. The new sequence is better. It does not create a partial reg write (setc ne= eds a clearing XOR in fron of CC-setting instruction).=