From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 767273858D1E; Mon, 26 Jun 2023 20:55:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 767273858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687812940; bh=rzTJFjcuJQ3oC35q88kU12AOF+WqFl3qpGodWXYHpJs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gakDpV2IKB3jHB+loSBz71EI1qi9+5q6ejL1zlxQwl+AwkS0Non0akBlr+j6N+Ube +To+i0xDsRfwNTpAAUbHQNouiy7JRUI6+7GOD87uUDNQRiGhWzaH9e0/C0rwJVYBtT MEZ97vC+QcXuhQ1CUKwm2qAzvR2Wfg9lxohe2LI8= From: "ibuclaw 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: Mon, 26 Jun 2023 20:55:39 +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: ibuclaw 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 #10 from ibuclaw at gcc dot gnu.org --- Looking at an ICE in stage2 D compiler for i686-darwin17, I realized that i= t's another facet of this issue. // aggregate.d import dsymbol; extern (C++) class AggregateDeclaration : ScopeDsymbol { Visibility visibility; override Visibility visible() { return visibility; } } // dsymbol.d struct Visibility { enum Kind { undefined } Kind kind; } extern(C++) class ScopeDsymbol { Visibility visible(); Visibility.Kind* visibilities;=20 } When compiling dsymbol.d, `struct Visibility` is set SImode. However when compiling aggregate.d it's instead given BLKmode. This causes all the difference in how it is returned. Any C++ code interfacing with this will crash due to the mismatch too.=