From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F27A03858D28; Tue, 27 Jun 2023 09:27:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F27A03858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687858073; bh=TrCd9XjVAYjp8ABu5w2FkrCL5WydavlYxTsojwRfM2w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=c23zE8pEFEekW2QtizLprRMIw92IhTgfeLoZNPU1AW4zVBDhhDksyrQhDctyIE4OZ aprtOJd/Mxonzwrtjz+KSowVq6+dsZ9qCEIOEMQ5yPgGQjOT5YSFcqQZbTXG/fxPtO kkHHUNItpe8tRlTY4WV05nAWcP5ngzCOOfsdipXc= From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110406] d: Wrong code-gen returning POD structs by value Date: Tue, 27 Jun 2023 09:27:53 +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: 13.1.0 X-Bugzilla-Keywords: ABI X-Bugzilla-Severity: normal X-Bugzilla-Who: iains 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=3D110406 --- Comment #12 from Iain Sandoe --- OTOH there was a second issue with zero-sized objects which was fixed thus: diff --git a/gcc/d/types.cc b/gcc/d/types.cc index a1f69bb02b7..020cc7de83f 100644 --- a/gcc/d/types.cc +++ b/gcc/d/types.cc @@ -581,6 +581,11 @@ finish_aggregate_mode (tree type) { for (tree field =3D TYPE_FIELDS (type); field; field =3D DECL_CHAIN (fie= ld)) { + /* Fields of type `typeof(*null)' have no size, so let them force the + record type mode to be computed as BLKmode. */ + if (TYPE_MAIN_VARIANT (TREE_TYPE (field)) =3D=3D noreturn_type_node) + break; + if (DECL_SIZE (field) =3D=3D NULL_TREE) return; }=