From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 19CD13858D20; Mon, 27 Feb 2023 09:51:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19CD13858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677491483; bh=8/srCmHeT1fwKj00Pm2OBYufVrJMcNr8CYgnJbd46cc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=x/tHEPB/N0aBZBdz0gT8MGjsmfQGSiVdZ/OdlqUHVqIIW6iSGTd4ddNvayaKunr1L 7/FlmKbjfUOe7ZHopzu0mjVikGC+SrUYCBdOJVCnKsUzpr6k6qRCpjRHYjpZLE58so 8NpWiwaEkhPJ5kY5MFmN5xy5JGzONlTmFWFsizqc= 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 09:51:22 +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: 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: cc 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 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek --- 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 shifts. GCC inline asm has always worked like that, the operand is 8-bit and in GCC constants are always sign-extended. If you try just static inline unsigned int foo (unsigned int a, signed char s) { asm volatile ("# %1" : "+r" (a) : "ic" ((unsigned char) -s)); return a; }=20 void bar (void) { foo (0, 1); } I get the same behavior of # $-1 with trunk or GCC 3.2. In the assembly, if you have a spot which accepts 8-bit quantity, one shoul= dn't care if it is signed or unsigned. If you care about the upper bits, you shouldn't pretend the operand is 8-bit but say 32-bit by adding (int) cast = to it.=