From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 97A7F3857705; Mon, 12 Jun 2023 08:57:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 97A7F3857705 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686560237; bh=rlmno9vC26xtDkrMTMoaWov6RGMMW+NMEC6V87XW174=; h=From:To:Subject:Date:In-Reply-To:References:From; b=K0zzEMvT6u7GujpQL3ijpEj2TaHp0M5P1h0T44zfVdk66eptbQw5SVPQ9Q+6ReoWX +vDzc2VG2+v5DQRBgmIKZZHhBCEV8y699onRC+LNpPFF2qYQ6B1KODIvRq46LGB3vx OOprqW3y7jXvXe5ScKQXTvpI/eObpsrOIxc4z0XA= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105838] [10/11/12 Regression] g++ 12.1.0 runs out of memory or time when building const std::vector of std::strings Date: Mon, 12 Jun 2023 08:57:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: compile-time-hog, memory-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 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=3D105838 --- Comment #23 from CVS Commits --- The trunk branch has been updated by Jason Merrill : https://gcc.gnu.org/g:2764335bd336f2360d465ffcaa8f2c33f7321ab4 commit r14-1705-g2764335bd336f2360d465ffcaa8f2c33f7321ab4 Author: Jason Merrill Date: Tue Dec 6 18:10:48 2022 -0500 c++: build initializer_list in a loop [PR105838] I previously applied this change in r13-4565 but reverted it due to PR108071. That PR was then fixed by r13-4712, but I didn't re-apply th= is change then because we weren't making the array static; since r14-1500 = for PR110070 we now make the initializer array static, so let's bring this back. In situations where the maybe_init_list_as_range optimization isn't via= ble, we can build an initializer_list with a loop over a constant ar= ray of string literals. This is represented using a VEC_INIT_EXPR, which required adjusting a couple of places that expected the initializer array to have the same type as = the target array and fixing build_vec_init not to undo our efforts. PR c++/105838 gcc/cp/ChangeLog: * call.cc (convert_like_internal) [ck_list]: Use maybe_init_list_as_array. * constexpr.cc (cxx_eval_vec_init_1): Init might have a different type. * tree.cc (build_vec_init_elt): Likewise. * init.cc (build_vec_init): Handle from_array from a TARGET_EXPR. Retain TARGET_EXPR of a different type. gcc/testsuite/ChangeLog: * g++.dg/tree-ssa/initlist-opt5.C: New test.=