From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6CCBE3858408; Tue, 21 Feb 2023 14:09:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6CCBE3858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676988563; bh=qlmEUHnYGedMszSLAoFPmnspugGPWNq9NzStcO55XAw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RUpBHMrdOHXGIn/11xQ9BZSJmwnqOr50xiQ8sFd87FFi9HUNJE9MqqGLi8JzZFbVZ GqWhZUjsapzb0+Z0JVgOcONieF4UutE4pM4huHDLVIBIWtVBrW4yUB/uxIscwDRnDu X5MF9RLvErkYTBDI40mFfcLEz99D8cjxL+wdzxEo= From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108243] [10/11/12/13 Regression] Missed optimization for static const std::string_view(const char*) Date: Tue, 21 Feb 2023 14:09:23 +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: 11.3.0 X-Bugzilla-Keywords: missed-optimization, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: ppalka 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=3D108243 --- Comment #11 from Patrick Palka --- The pending patch https://gcc.gnu.org/pipermail/gcc-patches/2023-February/612365.html will fix that. With that patch we'll statically initialize static const string_view foo("bar"); as we already do for static const string_view foo =3D {"bar"};=