From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B33B83852764; Wed, 13 Dec 2023 16:48:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B33B83852764 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1702486093; bh=xsNJeySHHMUDHvpRcFl4/xpjuQ/0m1pordtrzs23wrc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qNF4phTfcz5V4W5U2sLZ0jCTTgezFy9f/cw4FlmthPtV0VkX8H4V4olhr2LeEuIYx Q0JOrb8TagNuyRE4YMK+NgZsxyyDijMMdvKpArHaR+qe1yyei8c5eh8q2w4BPZWQHf 4pTAS2MtflgEo7uokMc66ErHM3/lZ7J6l8k2Cnao= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/108243] [11/12 Regression] Missed optimization for static const std::string_view(const char*) Date: Wed, 13 Dec 2023 16:48:13 +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: cvs-commit 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: 11.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 #16 from GCC Commits --- The trunk branch has been updated by Jason Merrill : https://gcc.gnu.org/g:958940eb3511e341e57606f5a2f5399bc89533cb commit r14-6506-g958940eb3511e341e57606f5a2f5399bc89533cb Author: Jason Merrill Date: Tue Dec 12 22:53:10 2023 -0500 c++: constant direct-initialization [PR108243] When testing the proposed patch for PR71093 I noticed that it changed t= he diagnostic for consteval-prop6.C. I then noticed that the diagnostic wasn't very helpful either way; it was complaining about modification of the '= x' variable, but it's not a problem to initialize a local variable with a consteval constructor as long as the value is actually constant, we wan= t to know why the value isn't constant. And then it turned out that this al= so fixed a missed-optimization bug in the testsuite. PR c++/108243 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_outermost_constant_expr): Turn a constructor CALL_EXPR into a TARGET_EXPR. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/consteval-prop6.C: Adjust diagnostic. * g++.dg/opt/is_constant_evaluated3.C: Remove xfails.=