From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB68A3857351; Tue, 18 Jul 2023 14:54:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB68A3857351 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689692072; bh=ZE+BEbzjBMShX1FLyRZqovVjxG4/+4oqHq6WFA+JV3U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=C9+yCBfbH7GqYoKcDdRHeOdLe2NRc2DZjimJGTMmnlsUnXyG1rdgbvSvNu7xtNYUx nzXeDLHDcnOvBvsY8KCQA1S1+ue8Elj9zg2A30F3w/iW9hP+FPDrbJeXauFhYWBCRM hj1KIzLyt+k1rMePkN/h8nhg5G2YISXBJ57DPCFA= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/110717] Double-word sign-extension missed-optimization Date: Tue, 18 Jul 2023 14:54:32 +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: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org 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=3D110717 --- Comment #2 from Jakub Jelinek --- Improved testcase which shows similar behavior also with bitfields: #ifdef __SIZEOF_INT128__ #define type __int128 #define N 59 #else #define type long long #define N 27 #endif struct S { type a : sizeof (type) * __CHAR_BIT__ - N; }; unsigned type foo (unsigned type x) { x <<=3D N; return ((type) x) >> N; } unsigned type bar (struct S *p) { return p->a; }=