From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DCF323858C20; Thu, 8 Jun 2023 15:44:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DCF323858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686239074; bh=l8hdf/wdhSxR5NnJQ9emapgFF8fM5z9w9ORKXCz6FPU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XLMsXjXRXA2b5e8B7Otq9hV7uK3h3n/IcLc1aPr2OhUWrzX+6QY08jff43MBkXsIo e4yHmyHlEZwmQE5gzh8jhh5MIaMCxU3WZUdVRQxf9ErIle/nhPrUmaobPxAuODQE7y lBsZXaGYMFLMNpu/KCN/fHKBtS3y6w4LnSOFLL8Y= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/110167] excessive compile time for std::to_array with huge arrays Date: Thu, 08 Jun 2023 15:44:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: compile-time-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi 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=3D110167 --- Comment #10 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #6) > if constexpr (_Nm > 1024 && is_trivially_default_constructible_v<_T= p> > && is_trivially_assignable_v<_Tp&, _Tp&>) > { > array<_Tp, _Nm> __arr; > for (size_t __i =3D 0; __i < _Nm; ++i) > __arr[__i] =3D __a[__i]; > return __arr; I wonder if we should do this for any N, and rely on the compiler to DTRT f= or the loop.=