From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 724893858CD1; Fri, 8 Dec 2023 17:37:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 724893858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1702057078; bh=EthNhFzGOIWTxwqaSVySBYYNVcGHfY8MnRtbuuPuPXM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WiVCEpRS8ErlaI7ZIOIWGXesjonUNvsk994rCVH7D14vBJQMZj1n/vfp68v0SX0hZ Ib0iffNprxbZxNPH2fgHucpigt36dBzj2cTNS1q+/+akqO5YNUT6zBP4OixkAfPwA5 NUFnYD2el2UKKhM9VRmjmFi5dijy5L3L1CWmtm38= From: "segher at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/112758] [13/14 Regression] Inconsistent Bitwise AND Operation Result between int and long long int Date: Fri, 08 Dec 2023 17:37:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: needs-bisection, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: segher at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 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=3D112758 --- Comment #4 from Segher Boessenkool --- WORD_REGISTER_OPERATIONS is extremely ill-defined. Or, it is used for other things than what it stands for, whichever way you want to look at it. A backend that defines the macro to non-zero promises that for *any* operat= ion on any values in a smaller than full-register mode, the compiler can instead do the operation in that full-register mode, and all the resulting bits will be well-defined. This is not true for most real non-trivial backends. There is word_register_operation_p to filter out the most obvious and egreg= ious cases where WORD_REGISTER_OPERATIONS is just a foolish thing, but this func= tion isn't used nearly enough, and it doesn't filter out enough either.=