This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] Add -fconstexpr-ops-limit= option (PR c++/87481, take 2)


On 3/22/19 8:53 AM, Jakub Jelinek wrote:
On Fri, Mar 22, 2019 at 08:47:21AM -0400, Jason Merrill wrote:
On 3/21/19 7:45 PM, Jakub Jelinek wrote:
On Thu, Mar 21, 2019 at 07:27:03PM -0400, Jason Merrill wrote:
On 3/15/19 4:07 PM, Jakub Jelinek wrote:
+/* Number of cxx_eval_constant_expression calls (except skipped ones,
+   on simple constants or location wrappers) encountered during current
+   cxx_eval_outermost_constant_expr call.  */
+static HOST_WIDE_INT constexpr_ops_count;

Hmm, a global static variable is non-reentrant.  This may not be an issue in
practice because of instantiate_constexpr_fns, but still seems questionable.

One option would be to add HOST_WIDE_INT *constexpr_ops_count; into
constexpr_ctx structure (pointer, not the counter itself, because we
    constexpr_ctx new_ctx = *ctx;
    ... (&new_ctx, ...)
).

That makes sense.

I've in the meantime bootstrapped/regtested on x86_64-linux and i686-linux
the following patch.  Ok for trunk?

OK.

I've also wondered about splitting out parts of the context that don't
change so frequently, to avoid adding an extra copy of 'strict' every time
we build a new ctx.

I agree it is a good idea.  Can that be done incrementally though?

Yes.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]