From: Jason Merrill <jason@redhat.com>
To: Marek Polacek <polacek@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:20:04 -0400 [thread overview]
Message-ID: <9e12adf7-9b12-aed4-6e72-6a6d2257aeeb@redhat.com> (raw)
In-Reply-To: <ZQmblQfvBTSZT2rO@redhat.com>
On 9/19/23 09:01, Marek Polacek wrote:
> 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.
Sure.
Jason
prev parent reply other threads:[~2023-09-19 13:20 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
2023-09-19 13:20 ` Jason Merrill [this message]
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=9e12adf7-9b12-aed4-6e72-6a6d2257aeeb@redhat.com \
--to=jason@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=polacek@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).