From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6A4833858417; Wed, 28 Jun 2023 18:52:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A4833858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687978375; bh=Zuvua7yLcEEmiqHMd+zCETL9CNtTD7CZPIGSK9wBvM8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=E4tEWM/ghf9DGIWBu97Lr1uoPbJ44O8vzgBRwM8AYIKhCrOjrXV37Oefur8/yBhWZ MsDXebuJHu8XsydenJNzRSBRkoukQjTD5flMi1qaZBuNpsoDpCA1pAs+t3zMVuQN0o 4Uj2b4Dp570nT1Ml39QsbWwJOd4kSvwalBgL6bQ8= From: "cvs-commit 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: Wed, 28 Jun 2023 18:52:55 +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: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ibuclaw 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 #15 from CVS Commits --- The releases/gcc-13 branch has been updated by Iain Buclaw : https://gcc.gnu.org/g:f2eeda5652438fe783d4e3878139481a1b8606b6 commit r13-7496-gf2eeda5652438fe783d4e3878139481a1b8606b6 Author: Iain Buclaw Date: Wed Jun 28 18:30:31 2023 +0200 d: Fix wrong code-gen when returning structs by value. Since r13-1104, structs have have compute_record_mode called too early on them, causing them to return differently depending on the order that types are generated in, and whether there are forward references. This patch moves the call to compute_record_mode into its own function, and calls it after all fields have been given a size. PR d/106977 PR target/110406 gcc/d/ChangeLog: * types.cc (finish_aggregate_mode): New function. (finish_incomplete_fields): Call finish_aggregate_mode. (finish_aggregate_type): Replace call to compute_record_mode wi= th finish_aggregate_mode. gcc/testsuite/ChangeLog: * gdc.dg/torture/pr110406.d: New test. (cherry picked from commit c201cd3be0d9ab887fafb0c33a9fc287c405c21c)=