From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 527E73858C62; Wed, 4 Jan 2023 17:22:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 527E73858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672852970; bh=8y9j/CqxPMO6hQW3WSi1X0yo3ysj/NS75gQNnekEob4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rEJLIMaohVG4C+foeXsGzY3BFjUvRei4QdanfRkO4WA8NgK27Jm59ZsuHMKcFFi78 poQdl4iRcuI+7fbXv2NO5Hu2hVHLHv49VoilKXFxtafy+htZ323b7VsSxmzDfzVXDD Mr0HaZE993gFJGymaJ2r0aaEUX5fPOcdPxhm34dM= From: "jakub 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: Wed, 04 Jan 2023 17:22:50 +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 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: --- 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=3D108243 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #6 from Jakub Jelinek --- We could have some FE constant expression evaluation mode in which we'd guarantee that if the initializer/expression was manifestly constant evalua= ted, it has been constant expression evaluated with manifestly_const_eval=3Dtrue already and do that as a last resort folding of initializers or perhaps expressions in cp_fold_function or so. But as you wrote, we can't do that by default for !manifestly_const_eval evaluation, because we often do that before we evaluate those with manifestly_const_eval=3Dtrue.=