From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A2DFD385842E; Sun, 10 Mar 2024 18:07:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A2DFD385842E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710094051; bh=wJNkfVUrTtaPQY6Znc+ZEJmVlwHgdhlo0mMtWr2YKd8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pOjSUBp2wK8ik7a0hflbuZnTEBvdlSVv0D8sNmfIMuVzcE5mGNW0rj39T/ArgRNaR ZDRbJm6HFn5uu8puQmb7WJhCfttpG6pX9bL94lLiSOKhuJ5WG8sATJYlqk/JOFS7Ip V/yd0K81d4P/Z3kOVd9Yj9l9ncd/m8p+GyyDCWNY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug d/112285] `in` class parameter with `gdc -fpreview=in` causes ICE Date: Sun, 10 Mar 2024 18:07:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: d X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ibuclaw at gdcproject dot 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=3D112285 --- Comment #1 from GCC Commits --- The master branch has been updated by Iain Buclaw : https://gcc.gnu.org/g:a84b98c62d90bf9e8b01038f624a62725e6a44db commit r14-9420-ga84b98c62d90bf9e8b01038f624a62725e6a44db Author: Iain Buclaw Date: Sun Mar 10 17:49:06 2024 +0100 d: Fix -fpreview=3Din ICEs with forward referenced parameter [PR112285] The way that the target hook preferPassByRef is implemented, it relied on the GCC "back-end" tree type to determine whether or not to use `ref' ABI for D `in' parameters; e.g: prefer by value if it is expected that the target will pass the type around in registers. Building the GCC tree type depends on the AST type being complete - all semantic processing is finished - but as this hook is called from the front-end, this will not be the case for forward referenced or self-referencing types. The consensus in upstream is that `in' parameters should always be implicitly `ref', but as the front-end does not yet support all types being rvalue references, limit this just static arrays and structs. PR d/112285 PR d/112290 gcc/d/ChangeLog: * d-target.cc (Target::preferPassByRef): Return true for all st= atic array and struct types. gcc/testsuite/ChangeLog: * gdc.dg/pr112285.d: New test. * gdc.dg/pr112290.d: New test.=