From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 393033858299; Wed, 29 Nov 2023 18:18:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 393033858299 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701281887; bh=zyrgonl/C7cmo45UBVwNcVxVj9skOPKO6aLjfcYqNFQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OUVVsKh/76mbjCc6VGJyHQ3wQseAIZ5ss9kHFQTG0VFKbkSfAJg3xNX53XwG+pQY+ 48zQm0M6KeiAvCs7RCz5AG1pV3aO44kx/lw1yBOR6ccAZStTTOIJg1x0rJsI2vrIc8 UkyitT5/jxomQxAV5vgowRzQO62R43aIxLzksC/w= From: "pinskia 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: Wed, 29 Nov 2023 18:18:06 +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: pinskia 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: component cf_reconfirmed_on short_desc keywords everconfirmed target_milestone bug_status 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 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Component|target |rtl-optimization Last reconfirmed| |2023-11-29 Summary|Inconsistent Bitwise AND |[13/14 Regression] |Operation Result between |Inconsistent Bitwise AND |int and long long int on |Operation Result between |Different Optimization |int and long long int |Levels in GCC Trunk | Keywords| |needs-bisection Ever confirmed|0 |1 Target Milestone|--- |13.3 Status|UNCONFIRMED |NEW --- Comment #1 from Andrew Pinski --- Trying 21, 18 -> 22: 21: r149:DI=3D0xffff00ffffffffff 18: r147:DI=3Dsign_extend([r143:DI+low(`globalVar')]) REG_DEAD r143:DI 22: r148:DI=3Dr147:DI&r149:DI REG_DEAD r149:DI REG_DEAD r147:DI REG_EQUAL r147:DI&0xffff00ffffffffff Successfully matched this instruction: (set (reg:DI 148) (zero_extend:DI (mem/c:SI (lo_sum:DI (reg/f:DI 143) (symbol_ref:DI ("globalVar") [flags 0x86] )) [1 globalVarD.2927+0 S4 A32]))) allowing combination of insns 18, 21 and 22 original costs 32 + 4 + 4 =3D 40 replacement cost 32 That is almost definitely wrong. Was working in GCC 12 but started to go wrong in GCC 13.=