From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 49A7C384C69A; Fri, 7 Jul 2023 19:21:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 49A7C384C69A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688757681; bh=AiptBMo9EwKhucutu7cebwMWrdTvpn+FfkWHBs5s3W0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cAAffB59JZPNcxEMMZpqbFQFPHQL4u1ltURw2ZzrgnwpPSHaYbM7nrGsxuCC5zgeH lDYW23R5eHeBdw3T1voYvAXsLHp5D+kYbb5x8LQ2DEY7Gh40xvf7iOokxtt9T8RXsY 6FpgaCjMAse/RdBvPdQHWy5aTsDK7GwLKoiTFydc= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug d/108842] Cannot use enum array with -fno-druntime Date: Fri, 07 Jul 2023 19:21:21 +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.0 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=3D108842 --- Comment #1 from CVS Commits --- The master branch has been updated by Iain Buclaw : https://gcc.gnu.org/g:f934c5753849f7c48c6a3abfcd73b8f6008e8371 commit r14-2385-gf934c5753849f7c48c6a3abfcd73b8f6008e8371 Author: Iain Buclaw Date: Fri Jul 7 21:06:07 2023 +0200 d: Fix PR 108842: Cannot use enum array with -fno-druntime Restrict the generating of CONST_DECLs for D manifest constants to just scalars without pointers. It shouldn't happen that a reference to a manifest constant has not been expanded within a function body during codegen, but it has been found to occur in older versions of the D front-end (PR98277), so if the decl of a non-scalar constant is requested, just return its initializer as an expression. PR d/108842 gcc/d/ChangeLog: * decl.cc (DeclVisitor::visit (VarDeclaration *)): Only emit sc= alar manifest constants. (get_symbol_decl): Don't generate CONST_DECL for non-scalar manifest constants. * imports.cc (ImportVisitor::visit (VarDeclaration *)): New met= hod. gcc/testsuite/ChangeLog: * gdc.dg/pr98277.d: Add more tests. * gdc.dg/pr108842.d: New test.=