From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 078AF3858C53; Wed, 4 Jan 2023 16:47:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 078AF3858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672850862; bh=K56RI8YDO13S0RJBTLzYtddBCmc5iPp7xf6VNWzdIqY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XSmXUptI0X4qjSKVwP/5MNRQ3jA7pQaAIFS+6NqHjwze55Fo9XcyCYAt2XBtM99kP W6lCVTeaeUGfirZ8s2SU3h1bMIW/beWRW3gjTCtMnke0t0KA7Zng3h8hHC9nMc3ZVI JxbrOYBkqQzWvi4V9FeX+fl5fnWtSF64gEMt4O1A= 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: Wed, 04 Jan 2023 16:47:41 +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: ppalka 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: see_also 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 Patrick Palka changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D97553 CC| |ppalka at gcc dot gnu.org --- Comment #5 from Patrick Palka --- IIUC __builtin_is_constant_evaluated() currently acts as an optimization barrier for the frontend's speculative folding since we don't want to prematurely fold is_constant_evaluated() to false if the expression in ques= tion would later be manifestly constant evaluated (in which case is_constant_evaluated() must be folded to true). PR97553 is caused by the = same issue I think.=