From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6A8113858C2D; Sat, 9 Dec 2023 09:11:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A8113858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1702113112; bh=9iiMQKF/JiL4cl4kBiJn+YOsm1td/sCM9/Ceiavo2rk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uGaONsPbgletkItAxtG4+dSrB2sFePu3r9ML0/bcb4hw7N9OD/0ypVIjZjLgdoM5u dX04VHXzMPdYfrMubockE8tNdp2XtVt+FXvlXi1IcTG2/hqoMu74c2tTd4jgDnjiqf nUu54wH3DFnNLbo7lv1JF/PT2NCVCu/sIhOfrmS4= From: "jakub 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: Sat, 09 Dec 2023 09:11:51 +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: jakub 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 #8 from Jakub Jelinek --- (In reply to Eric Botcazou from comment #7) > > I must say I have no idea what WORD_REGISTER_OPERATION says about the u= pper > > bits of a paradoxical SUBREG if it is a MEM and load_extend_op (inner_m= ode) > > is ZERO_EXTEND (zeros then? >=20 > Yes. >=20 > > Then this optimization is ok), or something else? And what it says on = REGs. >=20 > That it contains the result of the operation that was applied to the SUBR= EG > as if it was applied to the entire REG, provided that > word_register_operation_p is true. Otherwise, it's undefined. But if we see a REG in there, we don't really know what operation it was. Sure, if the operation is visible, we know it, but say PLUS can be extended either way. Which means punt on this optimization for WORD_REGISTER_OPERATIONS if the o= uter mode is word_mode, except when sub is a MEM and load_extend_op (inner_mode)= =3D=3D ZERO_EXTEND?=