public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marek Polacek <polacek@redhat.com>
To: Jason Merrill <jason@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH v7] c++: Move consteval folding to cp_fold_r
Date: Tue, 19 Sep 2023 09:01:09 -0400	[thread overview]
Message-ID: <ZQmblQfvBTSZT2rO@redhat.com> (raw)
In-Reply-To: <08c8d28b-e3e3-041e-a64c-543ef87e8ebb@redhat.com>

On Mon, Sep 18, 2023 at 09:36:31PM -0400, Jason Merrill wrote:
> On 9/18/23 17:42, Marek Polacek wrote:
> > +  /* The purpose of this is not to emit errors for mce_unknown.  */
> > +  const tsubst_flags_t complain = (data->flags == ff_fold_immediate
> > +				   ? tf_none : tf_error);
> 
> Maybe check flags & ff_mce_false, instead?  OK with that change.

Thanks!  And what do you think about:

--- a/gcc/cp/cp-gimplify.cc
+++ b/gcc/cp/cp-gimplify.cc
@@ -1162,7 +1162,8 @@ cp_fold_r (tree *stmt_p, int *walk_subtrees, void *data_)
   tree stmt = *stmt_p;
   enum tree_code code = TREE_CODE (stmt);

-  cp_fold_immediate_r (stmt_p, walk_subtrees, data);
+  if (cxx_dialect > cxx17)
+    cp_fold_immediate_r (stmt_p, walk_subtrees, data);

   *stmt_p = stmt = cp_fold (*stmt_p, data->flags);


since we can recurse on ?:, this could save some time.  It's sad that
it checks cxx_dialect in every invocation of cp_fold_r but still, it
should help.

Thanks again for the reviews,

Marek


  reply	other threads:[~2023-09-19 13:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-01 17:23 [PATCH] " Marek Polacek
2023-09-01 17:36 ` Marek Polacek
2023-09-05 14:52 ` Jason Merrill
2023-09-05 19:59   ` Marek Polacek
2023-09-05 20:36     ` Jason Merrill
2023-09-07 15:23       ` [PATCH v2] " Marek Polacek
2023-09-07 18:32         ` Jason Merrill
2023-09-08 18:24           ` [PATCH v3] " Marek Polacek
2023-09-12 21:26             ` Jason Merrill
2023-09-13 20:56               ` [PATCH v4] " Marek Polacek
2023-09-13 21:57                 ` Jason Merrill
2023-09-14  0:02                   ` [PATCH v5] " Marek Polacek
2023-09-15 18:08                     ` Jason Merrill
2023-09-15 20:32                       ` [PATCH v6] " Marek Polacek
2023-09-16 20:22                         ` Jason Merrill
2023-09-18 21:42                           ` [PATCH v7] " Marek Polacek
2023-09-19  1:36                             ` Jason Merrill
2023-09-19 13:01                               ` Marek Polacek [this message]
2023-09-19 13:20                                 ` Jason Merrill

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=ZQmblQfvBTSZT2rO@redhat.com \
    --to=polacek@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    /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).