From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3FFFC3858D32; Mon, 27 Feb 2023 10:57:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3FFFC3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677495474; bh=e90QYGzsKKhzQ0TMQA2qpMlPiYoXGr4BeUbCgNOS2Y4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Y9AcV/WKLZXfnA6TIqUMwptgWwe482dJ25gUFNzplLlWtKnApoecfOZDbbQdPYowD aRRwXS+opRiO8Tq4KorCYbI78dESfuLcY9K95S7tOKZHxYCsKvthzE5KA6YwwUctg8 lDf9C4dShFUTJcebbnn4wnv24q7HNz0IB6dDwM5g= 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:57:54 +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 #6 from jbeulich at suse dot com --- (In reply to Jakub Jelinek from comment #5) > GCC doesn't even have that information at all, at the RTL level it doesn't > know > if it was signed or unsigned. > All it has is the constraint and operand for it, like (reg:QI 126) or > (const_int -1). > As I said earlier, constants are always sign-extended from their mode. > One could e.g. have during expansion (set (reg:QI 126) (const_int -1)) > and later on asm_operands with "ic" and (reg:QI 126). Same assignment for > int8_t x =3D -1 or int8_t x =3D 255 or uint8_t x =3D -1 or uint8_t x =3D = 255, at > GIMPLE one can differentiate that based on types, at RTL one has just mod= e. While for int8_t x =3D -1 or int8_t x =3D 255 I can see that the result is = as described, for uint8_t x =3D -1 or uint8_t x =3D 255 (or, as in the example= , a constant the was cast to an unsigned 8-bit type) why is it not (const int 2= 55)?=