From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 70DF5388883F; Thu, 24 Mar 2022 09:39:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70DF5388883F From: "ebotcazou at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/102024] [12 Regression] zero width bitfields and ABIs Date: Thu, 24 Mar 2022 09:39:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ABI X-Bugzilla-Severity: normal X-Bugzilla-Who: ebotcazou 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: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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, 24 Mar 2022 09:39:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102024 Eric Botcazou changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot gnu.o= rg --- Comment #18 from Eric Botcazou --- > TYPE_MODE should be ok too, it is just passing of arguments by value and > returning by value that could be problematic on > aarch64, arm, i386, ia64, iq2000, mips, riscv, rs6000, s390, sh and sparc > I think sh is ok, it ignores integer_zerop (DECL_SIZE (field)). On SPARC, the 32-bit ABI passes structures by reference so is not concerned while the 64-bit ABI does the same as SH: /* Walk the real fields, but skip those with no size or a zero size. ??? Fields with variable offset are handled as having zero offset. */ for (tree field =3D TYPE_FIELDS (type); field; field =3D DECL_CHAIN (fiel= d)) if (TREE_CODE (field) =3D=3D FIELD_DECL) { if (!DECL_SIZE (field) || integer_zerop (DECL_SIZE (field))) continue; so is not affected either.=