From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E399D385840B; Fri, 22 Mar 2024 15:52:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E399D385840B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711122769; bh=HxxVye28KroyiSo+pYISFsto/MPzSOXFI+PVQk19FNc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yX7YUOfp6l482vcachVkZ6dNj9d4GwaReHP6MtMQ5wrIyPjb9KUeG8Xj9A+6hBYqi mRW0fU0TdN54QXBIZjMefC0vYXDcwJXISBV051wpqF54QrBLk0HRackVYcYalFDaFK jUYydu4NRpUhWqzk0IMpkP8wIpGWMUbYGSPMQQw4= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114426] [14 regression] ICE when building log4cxx on arm (cxx_eval_call_expression, at cp/constexpr.cc:3242) since r14-6507 Date: Fri, 22 Mar 2024 15:52:49 +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: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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=3D114426 --- Comment #8 from Jakub Jelinek --- 2024-03-22 Jakub Jelinek PR c++/114426 * cp-gimplify.cc (cp_fold): Don't call maybe_const_value on CALL_EXPRs to cdtors. * g++.dg/cpp2a/pr114426.C: New test. --- gcc/cp/cp-gimplify.cc.jj 2024-02-23 18:55:05.377594277 +0100 +++ gcc/cp/cp-gimplify.cc 2024-03-22 16:46:49.381442914 +0100 @@ -3395,7 +3395,14 @@ cp_fold (tree x, fold_flags_t flags) Do constexpr expansion of expressions where the call itself is n= ot constant, but the call followed by an INDIRECT_REF is. */ if (callee && DECL_DECLARED_CONSTEXPR_P (callee) - && !flag_no_inline) + && !flag_no_inline + /* Don't invoke it on cdtors. On + !targetm.cxx.cdtor_returns_this () it won't do anything as it + has void type, so don't do it on + targetm.cxx.cdtor_returns_this () targets either for + consistency. */ + && !DECL_CONSTRUCTOR_P (callee) + && !DECL_DESTRUCTOR_P (callee)) { mce_value manifestly_const_eval =3D mce_unknown; if (flags & ff_mce_false) --- gcc/testsuite/g++.dg/cpp2a/pr114426.C.jj 2024-03-22 16:49:55.6508828= 41 +0100 +++ gcc/testsuite/g++.dg/cpp2a/pr114426.C 2024-03-22 16:48:51.8297599= 97 +0100 @@ -0,0 +1,6 @@ +// PR c++/114426 +// { dg-do compile } + +struct A { virtual ~A (); }; +struct B : virtual A { virtual void foo () =3D 0; }; +struct C : B { C () {} }; fixes the ICE, but dunno whether something different shouldn't be done inst= ead.=