From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B3126385C6E4; Fri, 7 Jul 2023 19:25:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B3126385C6E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688757901; bh=ro2JZctcpEsvDh9Fj2hpFKGi/4ioRRqtOWfLr7vKHTc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BK8MBkOKB8s0DIZjv22NTBbX/nnbeh2i+JevEBzF9Rzoad/P3LNL5zshbOAqrTrJj FNWGlu6QG/jIBLcO1uKsx0XKvxzylmubu+nQDQtI8dtZOR5z/bIyfweGyTp2cEnK9/ qYQ8eTKajMazieC+sWL5fg9zrAgx17ES+HjRvqdQ= 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:25:01 +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 #3 from CVS Commits --- The releases/gcc-12 branch has been updated by Iain Buclaw : https://gcc.gnu.org/g:0444c2065aef569aa16e43cffc564c202a59af33 commit r12-9759-g0444c2065aef569aa16e43cffc564c202a59af33 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. (cherry picked from commit f934c5753849f7c48c6a3abfcd73b8f6008e8371)=