From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1A1563858C98; Mon, 12 Feb 2024 15:38:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A1563858C98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707752313; bh=x7Ipcn1TryXr1w17CoBacG4/73d5Xq8kxFGRriIjWpc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QaMIQ9fC2StPwM2ZqmCIsBOWoaOUAD43hJA9fEbJBxfGFsKOYavmRlzP3yKEqkR+b 5oamg+AXGk82pCa9ZIHagTqP75JVMRVX6v6zW1XDwLi5bp/ZGSEoR0y7/WScUghoTU sGhMj4qkZfNhdY3KlXiuiVNOaQANGuIXnl9eiY5E= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113835] [13/14 Regression] compiling std::vector with const size in C++20 is slow Date: Mon, 12 Feb 2024 15:38:32 +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.2.1 X-Bugzilla-Keywords: compile-time-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 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=3D113835 --- Comment #6 from Jakub Jelinek --- Should we really be reaching the limits for cases like this? I mean, all the default ctors produce the same value here and we could figu= re out that they are in no way dependent on the exact position of the element in the vector, nor allocating heap memory during constexpr evaluation, so ideally = we'd optimize and just fill in the whole initializer with the same value (ideally using range for the ctor index to even save compile time memory). Guess the hard part is find out the cases where the constexpr evaluation for element would be dependent on something that would prevent such an optimization.=