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 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.
Jason