From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 113003858D35; Mon, 27 Feb 2023 10:17:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 113003858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677493061; bh=tat9w4MFMVedozIKd6YzegtM17fNOL/bMU7nEhUmKjs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RTEI2pA13nwPtlS2ywOs0voJanAms+eiC1EtrYUl/e5talemSh8q5OfXRaJjptp24 MGe1/fJQzW9qqDqYDHXP/reQSV+O+aWCVkeCAz2m274Da6Y4nzHcgdxIR/hoOmMYlG XV4FrDX76+1D7HjlxxyLviPfCNnD1staPfLTv3bA= From: "jbeulich at suse dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108941] Error: operand type mismatch for `shr' with binutils master Date: Mon, 27 Feb 2023 10:17:40 +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: jbeulich at suse 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: 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 #4 from jbeulich at suse dot com --- (In reply to Jakub Jelinek from comment #1) > GCC inline asm has always worked like that, the operand is 8-bit and in G= CC > constants are always sign-extended. But then ... > If you try just > static inline unsigned int > foo (unsigned int a, signed char s) > { > asm volatile ("# %1" : "+r" (a) : "ic" ((unsigned char) -s)); this should be sign-extension of the supplied value, i.e. the (potentially negative) value cast to "unsigned char". And gas will be happy to accept th= at. > In the assembly, if you have a spot which accepts 8-bit quantity, one > shouldn't care if it is signed or unsigned. I firmly disagree: I assume you did look at the description of the gas chan= ge. A negative value for SHL may (by some) be viewed as reasonable (and as said= in the submission, I could have been convinced to further relax things, provid= ed fair arguments), but a negative value for RCL firmly is rubbish and hence should have been rejected years ago.=