From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 462FB3858C78; Mon, 27 Feb 2023 11:17:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 462FB3858C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677496631; bh=3DUZTwGOJx0wWygwlVRI2gNxWC1IQXAclML5HgmkMiM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mrFwQ0sekgqR7N6O4VLOwGkaZLaup97cY6WPMwhal5WhshfZ4JZL8dKCqSIqjavap fUe8XU1xf2Sb/Md4fXko4UHqZpVShwIuIMIwUs568ofJrKCCNGQk2DqL/QluTKDbT8 ef9JsMCgEuHdQ18wO3RKxo3c6ZHM/WhJfV6t8Oyk= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108941] Error: operand type mismatch for `shr' with binutils master Date: Mon, 27 Feb 2023 11:17:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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=3D108941 --- Comment #11 from Jakub Jelinek --- (In reply to jbeulich from comment #9) > (In reply to Jakub Jelinek from comment #1) > > How does that look like a gcc bug? It is either a binutils bug for not > > accepting it anymore, or ffmpeg-4 bug for relying on the negative shift= s. >=20 > While I'm not sure in how far reduction from original code has discarded = too > much context, the impression I'm getting is that they use inline assembly > because if the same way expressed in a similar way in C, the compiler wou= ld > warn. And then, rather than making the expression match C standard > requirements, assembly code was used instead to silence that diagnostic. Of course the code could use whatever_32bit >> (count & 31) and GCC wouldn't warn and on arches like x86 where the shr instruction does effectively the maski= ng would fold the masking into the actual shift instruction. Plus, it would m= ask constants at compile time to the right range.=