public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-114426-4-9Vs82axDbh@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114426-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114426

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
2024-03-22  Jakub Jelinek  <jakub@redhat.com>

        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 not
           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 = mce_unknown;
            if (flags & ff_mce_false)
--- gcc/testsuite/g++.dg/cpp2a/pr114426.C.jj    2024-03-22 16:49:55.650882841
+0100
+++ gcc/testsuite/g++.dg/cpp2a/pr114426.C       2024-03-22 16:48:51.829759997
+0100
@@ -0,0 +1,6 @@
+// PR c++/114426
+// { dg-do compile }
+
+struct A { virtual ~A (); };
+struct B : virtual A { virtual void foo () = 0; };
+struct C : B { C () {} };

fixes the ICE, but dunno whether something different shouldn't be done instead.

  parent reply	other threads:[~2024-03-22 15:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22  5:11 [Bug c++/114426] New: [14 regression] ICE when building log4cxx on arm (cxx_eval_call_expression, at cp/constexpr.cc:3242) sjames at gcc dot gnu.org
2024-03-22  5:12 ` [Bug c++/114426] " sjames at gcc dot gnu.org
2024-03-22  5:13 ` sjames at gcc dot gnu.org
2024-03-22  5:14 ` sjames at gcc dot gnu.org
2024-03-22  6:51 ` rguenth at gcc dot gnu.org
2024-03-22  7:26 ` pinskia at gcc dot gnu.org
2024-03-22  8:01 ` sjames at gcc dot gnu.org
2024-03-22 12:36 ` law at gcc dot gnu.org
2024-03-22 15:11 ` [Bug c++/114426] [14 regression] ICE when building log4cxx on arm (cxx_eval_call_expression, at cp/constexpr.cc:3242) since r14-6507 jakub at gcc dot gnu.org
2024-03-22 15:50 ` jakub at gcc dot gnu.org
2024-03-22 15:52 ` jakub at gcc dot gnu.org [this message]
2024-03-23  8:06 ` jakub at gcc dot gnu.org
2024-04-10  8:02 ` rguenth at gcc dot gnu.org
2024-04-12  9:59 ` jakub at gcc dot gnu.org
2024-04-12 17:58 ` cvs-commit at gcc dot gnu.org
2024-04-12 17:58 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-114426-4-9Vs82axDbh@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).