From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A383938708AC; Thu, 10 Dec 2020 08:22:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A383938708AC From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/98190] [11 Regression] GCC11 miscompiles code using _Bool when inlining: bfxil instruction misused since r11-165 Date: Thu, 10 Dec 2020 08:22:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2020 08:22:48 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98190 --- Comment #15 from Jakub Jelinek --- Created attachment 49727 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D49727&action=3Dedit gcc11-pr98190.patch So, I have bootstrapped/regtested this patch last night on x86_64, i686, aarch64, armv7hl, powerpc64le (and s390x still pending) linux. Unfortunately, on aarch64 it regresses: gcc.c-torture/execute/pr93213.c and on powerpc64le that test plus: g++.dg/warn/Wstrict-aliasing-bogus-char-1.C gcc.dg/pr87273.c gcc.dg/torture/pr91656-1.c gcc.dg/tree-ssa/pr92085-2.c gcc.dg/tree-ssa/pr94703.c Seems the assumption that for promoted SUBREG to_rtx the store is always to= all the bits is incorrect, e.g. on pr93213.c the memcpy is copying just half of the bits. So, shall we check the bitpos 0 bitsize all to_rtx bits for the store_rtx case and otherwise check depending on endianity if the most significant bit of to_rtx is overwritten and extend in that case?=