From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2CC493870885; Sat, 19 Aug 2023 09:22:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2CC493870885 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692436963; bh=6x2G1P8KSj8cWoyWdpn+S2lpsYMeT2YFutWsAPSKV8s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jffaV0rvcjzY9SmJm9VW/5+6vrgdeEtbfWNrZn1whUHwTK6IOntSlI3VcE22kQT5l 1tZ6R2HvjPgGo+lnMrYpZMxofJ7lbTurLCEOwwz0MxTem/m0iNynrNgsi/tt4cY/jO yRjJ0e6Vg3+tfMwXmII+jFEfx058cfcDWFMHb14Y= From: "fxcoudert at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105838] [11/12 Regression] g++ 12.1.0 runs out of memory or time when building const std::vector of std::strings Date: Sat, 19 Aug 2023 09:22:39 +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: fxcoudert 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: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 Francois-Xavier Coudert changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fxcoudert at gcc dot gnu.o= rg --- Comment #25 from Francois-Xavier Coudert = --- The new test (g++.dg/tree-ssa/initlist-opt5.C) fails on darwin. The gimple = dump is like this: void f (const char * p) { const struct basic_string * retval.0; const struct basic_string * D.24981; const struct basic_string * D.24982; long int D.24983; struct allocator D.24824; struct initializer_list lst; const struct basic_string D.24980[72]; try { lst =3D {}; lst._M_len =3D 72; D.24981 =3D &D.24980; D.24982 =3D D.24981; D.24983 =3D 71; try { _4 =3D D.24982; try { std::allocator::allocator (&D.24824); try { std::__cxx11::basic_string::basic_string (_4, "aahi= ng", &D.24824); D.24982 =3D D.24982 + 32; D.24983 =3D D.24983 + -1; _5 =3D D.24982; std::__cxx11::basic_string::basic_string (_5, "aali= is", &D.24824); D.24982 =3D D.24982 + 32; D.24983 =3D D.24983 + -1; _6 =3D D.24982; std::__cxx11::basic_string::basic_string (_6, "aarr= gh", &D.24824); D.24982 =3D D.24982 + 32; D.24983 =3D D.24983 + -1; _7 =3D D.24982; [...] std::__cxx11::basic_string::basic_string (_75, "absent", &D.24824); D.24982 =3D D.24982 + 32; D.24983 =3D D.24983 + -1; retval.0 =3D D.24981; D.24983 =3D 71; lst._M_array =3D &D.24980; } finally { std::allocator::~allocator (&D.24824); } } finally { D.24824 =3D {CLOBBER(eol)}; } } catch { { const struct basic_string * D.24984; if (D.24981 !=3D 0B) goto ; else goto ; : _1 =3D 71 - D.24983; _2 =3D (sizetype) _1; _3 =3D _2 * 32; D.24984 =3D D.24981 + _3; : if (D.24984 =3D=3D D.24981) goto ; else goto ; : D.24984 =3D D.24984 + 18446744073709551584; std::__cxx11::basic_string::~basic_string (D.24984); goto ; : goto ; : : } } try { g (&lst); } finally { { const struct basic_string * D.24985; D.24985 =3D &D.24980 + 2304; : if (&D.24980 =3D=3D D.24985) goto ; else goto ; : D.24985 =3D D.24985 + 18446744073709551584; std::__cxx11::basic_string::~basic_string (D.24985); goto ; : } } } finally { lst =3D {CLOBBER(eol)}; D.24980 =3D {CLOBBER(eol)}; } } __attribute__((always_inline)) void std::allocator::allocator (struct allocator * const this) { try { { std::__new_allocator::__new_allocator (this); try { } catch { std::__new_allocator::~__new_allocator (this); } } } catch { <<>> } } __attribute__((always_inline)) void std::__new_allocator::__new_allocator (struct __new_allocator * const this) { try { { } } catch { <<>> } } __attribute__((always_inline)) void std::allocator::~allocator (struct allocator * const this) { try { { try { } finally { std::__new_allocator::~__new_allocator (this); } } } catch { <<>> } } void std::__new_allocator::~__new_allocator (struct __new_allocator * const this) { try { { } } catch { <<>> } }=