+2015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
+
+ * c-omp.c (c_omp_split_clauses): Remove conditional compilation. Use
+ flag_checking.
+
2015-11-03 Bernd Schmidt <bschmidt@redhat.com>
PR c++-common/67882
OMP_CLAUSE_CHAIN (clauses) = cclauses[s];
cclauses[s] = clauses;
}
-#ifdef ENABLE_CHECKING
+
+ if (!flag_checking)
+ return;
+
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP)) == 0)
gcc_assert (cclauses[C_OMP_CLAUSE_SPLIT_TARGET] == NULL_TREE);
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_TEAMS)) == 0)
gcc_assert (cclauses[C_OMP_CLAUSE_SPLIT_FOR] == NULL_TREE);
if (code != OMP_SIMD)
gcc_assert (cclauses[C_OMP_CLAUSE_SPLIT_SIMD] == NULL_TREE);
-#endif
}
+2015-11-04 Mikhail Maltsev <maltsevm@gmail.com>
+
+ * call.c (validate_conversion_obstack): Define unconditionally.
+ * constexpr.c (maybe_constant_value, fold_non_dependent_expr): Use
+ gcc_checking_assert.
+ * cp-tree.h: Use CHECKING_P instead of ENABLE_CHECKING.
+ * decl2.c (cxx_post_compilation_parsing_cleanups): Use flag_checking.
+ * mangle.c (add_substitution): Likewise.
+ * method.c (maybe_explain_implicit_delete): Likewise.
+ * parser.c (cp_parser_template_argument_list): Remove conditional
+ compilation.
+ * pt.c (check_unstripped_args): Rename to...
+ (verify_unstripped_args): ... this and remove conditional compilation.
+ (retrieve_specialization): Guard call of verify_unstripped_args with
+ flag_checking.
+ (template_parm_to_arg): Remove conditional compilation.
+ (template_parms_to_args, coerce_template_parameter_pack,
+ coerce_template_parms): Likewise.
+ (tsubst_copy): Use flag_checking.
+ (type_unification_real): Remove conditional compilation.
+ (build_non_dependent_expr): Use flag_checking.
+ * tree.c (build_target_expr): Remove conditional compilation, use
+ gcc_checking_assert.
+ * typeck.c (comptypes): Likewise.
+ * typeck2.c (digest_init_r): Likewise.
+
2015-11-03 Jason Merrill <jason@redhat.com>
* pt.c (struct find_parameter_pack_data): Add
return c;
}
-#ifdef ENABLE_CHECKING
-
/* Make sure that all memory on the conversion obstack has been
freed. */
== obstack_base (&conversion_obstack)));
}
-#endif /* ENABLE_CHECKING */
-
/* Dynamically allocate an array of N conversions. */
static conversion **
}
r = cxx_eval_outermost_constant_expr (t, true, true, decl);
-#ifdef ENABLE_CHECKING
- gcc_assert (r == t
- || CONVERT_EXPR_P (t)
- || TREE_CODE (t) == VIEW_CONVERT_EXPR
- || (TREE_CONSTANT (t) && !TREE_CONSTANT (r))
- || !cp_tree_equal (r, t));
-#endif
+ gcc_checking_assert (r == t
+ || CONVERT_EXPR_P (t)
+ || TREE_CODE (t) == VIEW_CONVERT_EXPR
+ || (TREE_CONSTANT (t) && !TREE_CONSTANT (r))
+ || !cp_tree_equal (r, t));
return r;
}
}
tree r = cxx_eval_outermost_constant_expr (t, true, true, NULL_TREE);
-#ifdef ENABLE_CHECKING
/* cp_tree_equal looks through NOPs, so allow them. */
- gcc_assert (r == t
- || CONVERT_EXPR_P (t)
- || TREE_CODE (t) == VIEW_CONVERT_EXPR
- || (TREE_CONSTANT (t) && !TREE_CONSTANT (r))
- || !cp_tree_equal (r, t));
-#endif
+ gcc_checking_assert (r == t
+ || CONVERT_EXPR_P (t)
+ || TREE_CODE (t) == VIEW_CONVERT_EXPR
+ || (TREE_CONSTANT (t) && !TREE_CONSTANT (r))
+ || !cp_tree_equal (r, t));
return r;
}
else if (TREE_OVERFLOW_P (t))
property. */
#define SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE, INT_VALUE) \
NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE) = build_int_cst (NULL_TREE, INT_VALUE)
-#ifdef ENABLE_CHECKING
+#if CHECKING_P
#define GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT(NODE) \
int_cst_value (NON_DEFAULT_TEMPLATE_ARGS_COUNT (NODE))
#else
tsubst_flags_t);
extern bool is_std_init_list (tree);
extern bool is_list_ctor (tree);
-#ifdef ENABLE_CHECKING
extern void validate_conversion_obstack (void);
-#endif /* ENABLE_CHECKING */
extern void mark_versions_used (tree);
extern tree get_function_version_dispatcher (tree);
input_location = locus_at_end_of_parsing;
-#ifdef ENABLE_CHECKING
- validate_conversion_obstack ();
-#endif /* ENABLE_CHECKING */
+ if (flag_checking)
+ validate_conversion_obstack ();
timevar_stop (TV_PHASE_LATE_PARSING_CLEANUPS);
}
get_tree_code_name (TREE_CODE (node)), (void *) node);
node = c;
-#if ENABLE_CHECKING
/* Make sure NODE isn't already a candidate. */
- {
- int i;
- tree candidate;
+ if (flag_checking)
+ {
+ int i;
+ tree candidate;
- FOR_EACH_VEC_SAFE_ELT (G.substitutions, i, candidate)
- {
- gcc_assert (!(DECL_P (node) && node == candidate));
- gcc_assert (!(TYPE_P (node) && TYPE_P (candidate)
+ FOR_EACH_VEC_SAFE_ELT (G.substitutions, i, candidate)
+ {
+ gcc_assert (!(DECL_P (node) && node == candidate));
+ gcc_assert (!(TYPE_P (node) && TYPE_P (candidate)
&& same_type_p (node, candidate)));
- }
- }
-#endif /* ENABLE_CHECKING */
+ }
+ }
/* Put the decl onto the varray of substitution candidates. */
vec_safe_push (G.substitutions, node);
"deleted because its exception-specification does not "
"match the implicit exception-specification %qX",
decl, raises);
-#ifdef ENABLE_CHECKING
- else
+ else if (flag_checking)
gcc_unreachable ();
-#endif
pop_scope (scope);
}
parser->non_integral_constant_expression_p = saved_non_ice_p;
parser->integral_constant_expression_p = saved_ice_p;
parser->in_template_argument_list_p = saved_in_template_argument_list_p;
-#ifdef ENABLE_CHECKING
- SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (vec, TREE_VEC_LENGTH (vec));
-#endif
+ if (CHECKING_P)
+ SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (vec, TREE_VEC_LENGTH (vec));
return vec;
}
gone through coerce_template_parms by now. */
static void
-check_unstripped_args (tree args ATTRIBUTE_UNUSED)
+verify_unstripped_args (tree args)
{
-#ifdef ENABLE_CHECKING
++processing_template_decl;
if (!any_dependent_template_arguments_p (args))
{
}
}
--processing_template_decl;
-#endif
}
/* Retrieve the specialization (in the sense of [temp.spec] - a
? TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl))
: template_class_depth (DECL_CONTEXT (tmpl))));
- check_unstripped_args (args);
+ if (flag_checking)
+ verify_unstripped_args (args);
if (optimize_specialization_lookup_p (tmpl))
{
/* Turn this argument into a TYPE_ARGUMENT_PACK
with a single element, which expands T. */
tree vec = make_tree_vec (1);
-#ifdef ENABLE_CHECKING
- SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT
- (vec, TREE_VEC_LENGTH (vec));
-#endif
+ if (CHECKING_P)
+ SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (vec, TREE_VEC_LENGTH (vec));
+
TREE_VEC_ELT (vec, 0) = make_pack_expansion (t);
t = cxx_make_type (TYPE_ARGUMENT_PACK);
with a single element, which expands T. */
tree vec = make_tree_vec (1);
tree type = TREE_TYPE (TEMPLATE_PARM_DECL (t));
-#ifdef ENABLE_CHECKING
- SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT
- (vec, TREE_VEC_LENGTH (vec));
-#endif
+ if (CHECKING_P)
+ SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (vec, TREE_VEC_LENGTH (vec));
+
t = convert_from_reference (t);
TREE_VEC_ELT (vec, 0) = make_pack_expansion (t);
for (i = TREE_VEC_LENGTH (a) - 1; i >= 0; --i)
TREE_VEC_ELT (a, i) = template_parm_to_arg (TREE_VEC_ELT (a, i));
-#ifdef ENABLE_CHECKING
- SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (a, TREE_VEC_LENGTH (a));
-#endif
+ if (CHECKING_P)
+ SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (a, TREE_VEC_LENGTH (a));
if (length > 1)
TREE_VEC_ELT (args, --l) = a;
}
SET_ARGUMENT_PACK_ARGS (argument_pack, packed_args);
-#ifdef ENABLE_CHECKING
- SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (packed_args,
- TREE_VEC_LENGTH (packed_args));
-#endif
+ if (CHECKING_P)
+ SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (packed_args,
+ TREE_VEC_LENGTH (packed_args));
return argument_pack;
}
if (lost)
return error_mark_node;
-#ifdef ENABLE_CHECKING
- if (!NON_DEFAULT_TEMPLATE_ARGS_COUNT (new_inner_args))
+ if (CHECKING_P && !NON_DEFAULT_TEMPLATE_ARGS_COUNT (new_inner_args))
SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (new_inner_args,
TREE_VEC_LENGTH (new_inner_args));
-#endif
return new_inner_args;
}
return tsubst_binary_right_fold (t, args, complain, in_decl);
default:
- /* We shouldn't get here, but keep going if !ENABLE_CHECKING. */
- gcc_checking_assert (false);
+ /* We shouldn't get here, but keep going if !flag_checking. */
+ if (flag_checking)
+ gcc_unreachable ();
return t;
}
}
if (saw_undeduced++ == 1)
goto again;
}
-#ifdef ENABLE_CHECKING
- if (!NON_DEFAULT_TEMPLATE_ARGS_COUNT (targs))
+
+ if (CHECKING_P && !NON_DEFAULT_TEMPLATE_ARGS_COUNT (targs))
SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (targs, TREE_VEC_LENGTH (targs));
-#endif
return unify_success (explain_p);
}
{
tree inner_expr;
-#ifdef ENABLE_CHECKING
/* Try to get a constant value for all non-dependent expressions in
order to expose bugs in *_dependent_expression_p and constexpr. */
- if (cxx_dialect >= cxx11)
+ if (flag_checking && cxx_dialect >= cxx11)
fold_non_dependent_expr (expr);
-#endif
/* Preserve OVERLOADs; the functions must be available to resolve
types. */
tree t;
tree type = TREE_TYPE (decl);
-#ifdef ENABLE_CHECKING
- gcc_assert (VOID_TYPE_P (TREE_TYPE (value))
- || TREE_TYPE (decl) == TREE_TYPE (value)
- /* On ARM ctors return 'this'. */
- || (TYPE_PTR_P (TREE_TYPE (value))
- && TREE_CODE (value) == CALL_EXPR)
- || useless_type_conversion_p (TREE_TYPE (decl),
- TREE_TYPE (value)));
-#endif
+ gcc_checking_assert (VOID_TYPE_P (TREE_TYPE (value))
+ || TREE_TYPE (decl) == TREE_TYPE (value)
+ /* On ARM ctors return 'this'. */
+ || (TYPE_PTR_P (TREE_TYPE (value))
+ && TREE_CODE (value) == CALL_EXPR)
+ || useless_type_conversion_p (TREE_TYPE (decl),
+ TREE_TYPE (value)));
t = cxx_maybe_build_cleanup (decl, complain);
if (t == error_mark_node)
perform a deep check. */
return structural_comptypes (t1, t2, strict);
-#ifdef ENABLE_CHECKING
- if (USE_CANONICAL_TYPES)
+ if (flag_checking && USE_CANONICAL_TYPES)
{
bool result = structural_comptypes (t1, t2, strict);
return result;
}
-#else
- if (USE_CANONICAL_TYPES)
+ if (!flag_checking && USE_CANONICAL_TYPES)
return TYPE_CANONICAL (t1) == TYPE_CANONICAL (t2);
-#endif
else
return structural_comptypes (t1, t2, strict);
}
|| TREE_CODE (type) == UNION_TYPE
|| TREE_CODE (type) == COMPLEX_TYPE);
-#ifdef ENABLE_CHECKING
/* "If T is a class type and the initializer list has a single
element of type cv U, where U is T or a class derived from T,
the object is initialized from that element." */
- if (cxx_dialect >= cxx11
+ if (flag_checking
+ && cxx_dialect >= cxx11
&& BRACE_ENCLOSED_INITIALIZER_P (init)
&& CONSTRUCTOR_NELTS (init) == 1
&& ((CLASS_TYPE_P (type) && !CLASSTYPE_NON_AGGREGATE (type))
/* We should have fixed this in reshape_init. */
gcc_unreachable ();
}
-#endif
if (BRACE_ENCLOSED_INITIALIZER_P (init)
&& !TYPE_NON_AGGREGATE_CLASS (type))