Commit 8dc2b103 by Nathan Sidwell Committed by Nathan Sidwell

call.c (check_dtor_name): Replace abort with gcc_assert or gcc_unreachable.

	* call.c (check_dtor_name): Replace abort with gcc_assert or
	gcc_unreachable.
	(build_call, add_builtin_candidate, build_new_op,
	convert_like_real, build_over_call, in_charge_arg_for_name,
	source_type, joust): Likewise.
	* class.c (build_simple_base_path, get_vcall_index,
	finish_struct_1, instantiate_type, get_enclosing_class,
	add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
	* cp-gimplify.c (cp_genericize): Likewise.
	* cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
	* cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
	* decl.c (poplevel, make_unbound_class_template, reshape_init,
	check_special_function_return_type, grokdeclarator,
	grok_op_properties, tag_name, xref_tag, start_preparsed_function,
	finish_function): Likewise.
	* decl2.c (grokfield, maybe_emit_vtables):Likewise.
	* error.c (dump_global_iord, dump_decl, dump_template_decl,
	language_to_string): Likewise.
	* except.c (choose_personality_routine): Likewise.
	* friend.c (do_friend): Likewise.
	* g++spec.c (lang_specific_driver): Likewise.
	* init.c (build_zero_init, expand_default_init, build_new_1,
	build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
	* lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
	* mangle.c (add_substitution, write_unscoped_name,
	write_template_prefix, write_identifier,
	write_special_name_destructor, write_type, write_builtin_type,
	write_expression, write_template_param,
	write_java_integer_type_codes): Likewise.
	* method.c (implicitly_declare_fn): Likewise.

From-SVN: r86778
parent e7023b0f
2004-08-30 Nathan Sidwell <nathan@codesourcery.com> 2004-08-30 Nathan Sidwell <nathan@codesourcery.com>
* call.c (check_dtor_name): Replace abort with gcc_assert or
gcc_unreachable.
(build_call, add_builtin_candidate, build_new_op,
convert_like_real, build_over_call, in_charge_arg_for_name,
source_type, joust): Likewise.
* class.c (build_simple_base_path, get_vcall_index,
finish_struct_1, instantiate_type, get_enclosing_class,
add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
* cp-gimplify.c (cp_genericize): Likewise.
* cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
* cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
* decl.c (poplevel, make_unbound_class_template, reshape_init,
check_special_function_return_type, grokdeclarator,
grok_op_properties, tag_name, xref_tag, start_preparsed_function,
finish_function): Likewise.
* decl2.c (grokfield, maybe_emit_vtables):Likewise.
* error.c (dump_global_iord, dump_decl, dump_template_decl,
language_to_string): Likewise.
* except.c (choose_personality_routine): Likewise.
* friend.c (do_friend): Likewise.
* g++spec.c (lang_specific_driver): Likewise.
* init.c (build_zero_init, expand_default_init, build_new_1,
build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
* lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
* mangle.c (add_substitution, write_unscoped_name,
write_template_prefix, write_identifier,
write_special_name_destructor, write_type, write_builtin_type,
write_expression, write_template_param,
write_java_integer_type_codes): Likewise.
* method.c (implicitly_declare_fn): Likewise.
2004-08-30 Nathan Sidwell <nathan@codesourcery.com>
* cp-tree.h (BINFO_PRIMARY_P): Use a binfo flag. * cp-tree.h (BINFO_PRIMARY_P): Use a binfo flag.
(BINFO_INDIRECT_PRIMARY_P): Remove. (BINFO_INDIRECT_PRIMARY_P): Remove.
* class.c (determine_primary_base): Rename to ... * class.c (determine_primary_base): Rename to ...
......
...@@ -234,6 +234,8 @@ check_dtor_name (tree basetype, tree name) ...@@ -234,6 +234,8 @@ check_dtor_name (tree basetype, tree name)
else else
name = get_type_value (name); name = get_type_value (name);
} }
else
{
/* In the case of: /* In the case of:
template <class T> struct S { ~S(); }; template <class T> struct S { ~S(); };
...@@ -241,10 +243,9 @@ check_dtor_name (tree basetype, tree name) ...@@ -241,10 +243,9 @@ check_dtor_name (tree basetype, tree name)
i.~S(); i.~S();
NAME will be a class template. */ NAME will be a class template. */
else if (DECL_CLASS_TEMPLATE_P (name)) gcc_assert (DECL_CLASS_TEMPLATE_P (name));
return false; return false;
else }
abort ();
if (name && TYPE_MAIN_VARIANT (basetype) == TYPE_MAIN_VARIANT (name)) if (name && TYPE_MAIN_VARIANT (basetype) == TYPE_MAIN_VARIANT (name))
return true; return true;
...@@ -328,11 +329,10 @@ build_call (tree function, tree parms) ...@@ -328,11 +329,10 @@ build_call (tree function, tree parms)
/* We invoke build_call directly for several library functions. /* We invoke build_call directly for several library functions.
These may have been declared normally if we're building libgcc, These may have been declared normally if we're building libgcc,
so we can't just check DECL_ARTIFICIAL. */ so we can't just check DECL_ARTIFICIAL. */
if (DECL_ARTIFICIAL (decl) gcc_assert (DECL_ARTIFICIAL (decl)
|| !strncmp (IDENTIFIER_POINTER (DECL_NAME (decl)), "__", 2)) || !strncmp (IDENTIFIER_POINTER (DECL_NAME (decl)),
"__", 2));
mark_used (decl); mark_used (decl);
else
abort ();
} }
/* Don't pass empty class objects by value. This is useful /* Don't pass empty class objects by value. This is useful
...@@ -1915,7 +1915,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, ...@@ -1915,7 +1915,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
return; return;
default: default:
abort (); gcc_unreachable ();
} }
type1 = build_reference_type (type1); type1 = build_reference_type (type1);
break; break;
...@@ -1952,7 +1952,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, ...@@ -1952,7 +1952,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
break; break;
default: default:
abort (); gcc_unreachable ();
} }
/* If we're dealing with two pointer types or two enumeral types, /* If we're dealing with two pointer types or two enumeral types,
...@@ -3600,7 +3600,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, ...@@ -3600,7 +3600,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3,
case VEC_DELETE_EXPR: case VEC_DELETE_EXPR:
case DELETE_EXPR: case DELETE_EXPR:
/* Use build_op_new_call and build_op_delete_call instead. */ /* Use build_op_new_call and build_op_delete_call instead. */
abort (); gcc_unreachable ();
case CALL_EXPR: case CALL_EXPR:
return build_object_call (arg1, arg2); return build_object_call (arg1, arg2);
...@@ -3836,7 +3836,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, ...@@ -3836,7 +3836,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3,
if (result || result_valid_p) if (result || result_valid_p)
return result; return result;
builtin: builtin:
switch (code) switch (code)
{ {
case MODIFY_EXPR: case MODIFY_EXPR:
...@@ -3895,9 +3895,9 @@ builtin: ...@@ -3895,9 +3895,9 @@ builtin:
return NULL_TREE; return NULL_TREE;
default: default:
abort (); gcc_unreachable ();
return NULL_TREE;
} }
return NULL_TREE;
} }
/* Build a call to operator delete. This has to be handled very specially, /* Build a call to operator delete. This has to be handled very specially,
...@@ -4180,11 +4180,10 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, ...@@ -4180,11 +4180,10 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
0); 0);
args = build_tree_list (NULL_TREE, expr); args = build_tree_list (NULL_TREE, expr);
if (DECL_HAS_IN_CHARGE_PARM_P (convfn)
|| DECL_HAS_VTT_PARM_P (convfn))
/* We should never try to call the abstract or base constructor /* We should never try to call the abstract or base constructor
from here. */ from here. */
abort (); gcc_assert (!DECL_HAS_IN_CHARGE_PARM_P (convfn)
&& !DECL_HAS_VTT_PARM_P (convfn));
args = tree_cons (NULL_TREE, t, args); args = tree_cons (NULL_TREE, t, args);
} }
else else
...@@ -4649,9 +4648,9 @@ build_over_call (struct z_candidate *cand, int flags) ...@@ -4649,9 +4648,9 @@ build_over_call (struct z_candidate *cand, int flags)
converted_args = tree_cons (NULL_TREE, TREE_VALUE (arg), converted_args); converted_args = tree_cons (NULL_TREE, TREE_VALUE (arg), converted_args);
arg = TREE_CHAIN (arg); arg = TREE_CHAIN (arg);
parm = TREE_CHAIN (parm); parm = TREE_CHAIN (parm);
if (DECL_HAS_IN_CHARGE_PARM_P (fn))
/* We should never try to call the abstract constructor. */ /* We should never try to call the abstract constructor. */
abort (); gcc_assert (!DECL_HAS_IN_CHARGE_PARM_P (fn));
if (DECL_HAS_VTT_PARM_P (fn)) if (DECL_HAS_VTT_PARM_P (fn))
{ {
converted_args = tree_cons converted_args = tree_cons
...@@ -4967,7 +4966,9 @@ build_java_interface_fn_ref (tree fn, tree instance) ...@@ -4967,7 +4966,9 @@ build_java_interface_fn_ref (tree fn, tree instance)
} }
/* Returns the value to use for the in-charge parameter when making a /* Returns the value to use for the in-charge parameter when making a
call to a function with the indicated NAME. */ call to a function with the indicated NAME.
FIXME:Can't we find a neater way to do this mapping? */
tree tree
in_charge_arg_for_name (tree name) in_charge_arg_for_name (tree name)
...@@ -4984,7 +4985,7 @@ in_charge_arg_for_name (tree name) ...@@ -4984,7 +4985,7 @@ in_charge_arg_for_name (tree name)
/* This function should only be called with one of the names listed /* This function should only be called with one of the names listed
above. */ above. */
abort (); gcc_unreachable ();
return NULL_TREE; return NULL_TREE;
} }
...@@ -5838,7 +5839,7 @@ source_type (conversion *t) ...@@ -5838,7 +5839,7 @@ source_type (conversion *t)
|| t->kind == ck_identity) || t->kind == ck_identity)
return t->type; return t->type;
} }
abort (); gcc_unreachable ();
} }
/* Note a warning about preferring WINNER to LOSER. We do this by storing /* Note a warning about preferring WINNER to LOSER. We do this by storing
...@@ -5899,17 +5900,18 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) ...@@ -5899,17 +5900,18 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn)
len = cand1->num_convs; len = cand1->num_convs;
if (len != cand2->num_convs) if (len != cand2->num_convs)
{ {
if (DECL_STATIC_FUNCTION_P (cand1->fn) int static_1 = DECL_STATIC_FUNCTION_P (cand1->fn);
&& ! DECL_STATIC_FUNCTION_P (cand2->fn)) int static_2 = DECL_STATIC_FUNCTION_P (cand2->fn);
gcc_assert (static_1 != static_2);
if (static_1)
off2 = 1; off2 = 1;
else if (! DECL_STATIC_FUNCTION_P (cand1->fn) else
&& DECL_STATIC_FUNCTION_P (cand2->fn))
{ {
off1 = 1; off1 = 1;
--len; --len;
} }
else
abort ();
} }
for (i = 0; i < len; ++i) for (i = 0; i < len; ++i)
......
...@@ -418,8 +418,7 @@ build_simple_base_path (tree expr, tree binfo) ...@@ -418,8 +418,7 @@ build_simple_base_path (tree expr, tree binfo)
if (d_binfo == NULL_TREE) if (d_binfo == NULL_TREE)
{ {
if (TYPE_MAIN_VARIANT (TREE_TYPE (expr)) != type) gcc_assert (TYPE_MAIN_VARIANT (TREE_TYPE (expr)) == type);
abort ();
return expr; return expr;
} }
...@@ -436,7 +435,7 @@ build_simple_base_path (tree expr, tree binfo) ...@@ -436,7 +435,7 @@ build_simple_base_path (tree expr, tree binfo)
NULL_TREE, false); NULL_TREE, false);
/* Didn't find the base field?!? */ /* Didn't find the base field?!? */
abort (); gcc_unreachable ();
} }
/* Convert OBJECT to the base TYPE. If CHECK_ACCESS is true, an error /* Convert OBJECT to the base TYPE. If CHECK_ACCESS is true, an error
...@@ -2007,9 +2006,7 @@ get_vcall_index (tree fn, tree type) ...@@ -2007,9 +2006,7 @@ get_vcall_index (tree fn, tree type)
return p->value; return p->value;
/* There should always be an appropriate index. */ /* There should always be an appropriate index. */
abort (); gcc_unreachable ();
return NULL_TREE;
} }
/* Update an entry in the vtable for BINFO, which is in the hierarchy /* Update an entry in the vtable for BINFO, which is in the hierarchy
...@@ -4928,10 +4925,8 @@ finish_struct_1 (tree t) ...@@ -4928,10 +4925,8 @@ finish_struct_1 (tree t)
if (COMPLETE_TYPE_P (t)) if (COMPLETE_TYPE_P (t))
{ {
if (IS_AGGR_TYPE (t)) gcc_assert (IS_AGGR_TYPE (t));
error ("redefinition of `%#T'", t); error ("redefinition of `%#T'", t);
else
abort ();
popclass (); popclass ();
return; return;
} }
...@@ -5942,8 +5937,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) ...@@ -5942,8 +5937,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
case CONVERT_EXPR: case CONVERT_EXPR:
case SAVE_EXPR: case SAVE_EXPR:
case CONSTRUCTOR: case CONSTRUCTOR:
abort (); gcc_unreachable ();
return error_mark_node;
case INDIRECT_REF: case INDIRECT_REF:
case ARRAY_REF: case ARRAY_REF:
...@@ -6014,8 +6008,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) ...@@ -6014,8 +6008,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
case CALL_EXPR: case CALL_EXPR:
/* This is too hard for now. */ /* This is too hard for now. */
abort (); gcc_unreachable ();
return error_mark_node;
case PLUS_EXPR: case PLUS_EXPR:
case MINUS_EXPR: case MINUS_EXPR:
...@@ -6124,9 +6117,9 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) ...@@ -6124,9 +6117,9 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
return error_mark_node; return error_mark_node;
default: default:
abort (); gcc_unreachable ();
return error_mark_node;
} }
return error_mark_node;
} }
/* Return the name of the virtual function pointer field /* Return the name of the virtual function pointer field
...@@ -6273,7 +6266,7 @@ get_enclosing_class (tree type) ...@@ -6273,7 +6266,7 @@ get_enclosing_class (tree type)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
return NULL_TREE; return NULL_TREE;
...@@ -7604,8 +7597,7 @@ add_vcall_offset_vtbl_entries_1 (tree binfo, vtbl_init_data* vid) ...@@ -7604,8 +7597,7 @@ add_vcall_offset_vtbl_entries_1 (tree binfo, vtbl_init_data* vid)
might be a lost primary, so just skip down to vid->binfo. */ might be a lost primary, so just skip down to vid->binfo. */
if (BINFO_VIRTUAL_P (non_primary_binfo)) if (BINFO_VIRTUAL_P (non_primary_binfo))
{ {
if (non_primary_binfo != vid->vbase) gcc_assert (non_primary_binfo == vid->vbase);
abort ();
non_primary_binfo = vid->binfo; non_primary_binfo = vid->binfo;
break; break;
} }
...@@ -7794,8 +7786,8 @@ cp_fold_obj_type_ref (tree ref, tree known_type) ...@@ -7794,8 +7786,8 @@ cp_fold_obj_type_ref (tree ref, tree known_type)
fndecl = BV_FN (v); fndecl = BV_FN (v);
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
if (!tree_int_cst_equal (OBJ_TYPE_REF_TOKEN (ref), DECL_VINDEX (fndecl))) gcc_assert (tree_int_cst_equal (OBJ_TYPE_REF_TOKEN (ref),
abort (); DECL_VINDEX (fndecl)));
#endif #endif
return build_address (fndecl); return build_address (fndecl);
......
...@@ -329,12 +329,10 @@ cp_genericize (tree fndecl) ...@@ -329,12 +329,10 @@ cp_genericize (tree fndecl)
/* Fix up the types of parms passed by invisible reference. */ /* Fix up the types of parms passed by invisible reference. */
for (t = DECL_ARGUMENTS (fndecl); t; t = TREE_CHAIN (t)) for (t = DECL_ARGUMENTS (fndecl); t; t = TREE_CHAIN (t))
{ {
if (DECL_BY_REFERENCE (t)) gcc_assert (!DECL_BY_REFERENCE (t));
abort ();
if (TREE_ADDRESSABLE (TREE_TYPE (t))) if (TREE_ADDRESSABLE (TREE_TYPE (t)))
{ {
if (DECL_ARG_TYPE (t) == TREE_TYPE (t)) gcc_assert (DECL_ARG_TYPE (t) != TREE_TYPE (t));
abort ();
TREE_TYPE (t) = DECL_ARG_TYPE (t); TREE_TYPE (t) = DECL_ARG_TYPE (t);
DECL_BY_REFERENCE (t) = 1; DECL_BY_REFERENCE (t) = 1;
TREE_ADDRESSABLE (t) = 0; TREE_ADDRESSABLE (t) = 0;
......
...@@ -260,13 +260,13 @@ cp_expr_size (tree exp) ...@@ -260,13 +260,13 @@ cp_expr_size (tree exp)
/* The backend should not be interested in the size of an expression /* The backend should not be interested in the size of an expression
of a type with both of these set; all copies of such types must go of a type with both of these set; all copies of such types must go
through a constructor or assignment op. */ through a constructor or assignment op. */
if (TYPE_HAS_COMPLEX_INIT_REF (TREE_TYPE (exp)) gcc_assert (!TYPE_HAS_COMPLEX_INIT_REF (TREE_TYPE (exp))
&& TYPE_HAS_COMPLEX_ASSIGN_REF (TREE_TYPE (exp)) || !TYPE_HAS_COMPLEX_ASSIGN_REF (TREE_TYPE (exp))
/* But storing a CONSTRUCTOR isn't a copy. */ /* But storing a CONSTRUCTOR isn't a copy. */
&& TREE_CODE (exp) != CONSTRUCTOR) || TREE_CODE (exp) == CONSTRUCTOR);
abort ();
/* This would be wrong for a type with virtual bases, but they are /* This would be wrong for a type with virtual bases, but they are
caught by the abort above. */ caught by the assert above. */
return (is_empty_class (TREE_TYPE (exp)) return (is_empty_class (TREE_TYPE (exp))
? size_zero_node ? size_zero_node
: CLASSTYPE_SIZE_UNIT (TREE_TYPE (exp))); : CLASSTYPE_SIZE_UNIT (TREE_TYPE (exp)));
...@@ -289,7 +289,7 @@ cp_tree_size (enum tree_code code) ...@@ -289,7 +289,7 @@ cp_tree_size (enum tree_code code)
case DEFAULT_ARG: return sizeof (struct tree_default_arg); case DEFAULT_ARG: return sizeof (struct tree_default_arg);
case OVERLOAD: return sizeof (struct tree_overload); case OVERLOAD: return sizeof (struct tree_overload);
default: default:
abort (); gcc_unreachable ();
} }
/* NOTREACHED */ /* NOTREACHED */
} }
......
...@@ -284,12 +284,12 @@ cp_convert_to_pointer (tree type, tree expr, bool force) ...@@ -284,12 +284,12 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
if (TYPE_PRECISION (intype) == POINTER_SIZE) if (TYPE_PRECISION (intype) == POINTER_SIZE)
return build1 (CONVERT_EXPR, type, expr); return build1 (CONVERT_EXPR, type, expr);
expr = cp_convert (c_common_type_for_size (POINTER_SIZE, 0), expr); expr = cp_convert (c_common_type_for_size (POINTER_SIZE, 0), expr);
/* Modes may be different but sizes should be the same. */ /* Modes may be different but sizes should be the same. There
if (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr))) is supposed to be some integral type that is the same width
!= GET_MODE_SIZE (TYPE_MODE (type))) as a pointer. */
/* There is supposed to be some integral type gcc_assert (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr)))
that is the same width as a pointer. */ == GET_MODE_SIZE (TYPE_MODE (type)));
abort ();
return convert_to_pointer (type, expr); return convert_to_pointer (type, expr);
} }
...@@ -647,18 +647,19 @@ ocp_convert (tree type, tree expr, int convtype, int flags) ...@@ -647,18 +647,19 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
/* Don't build a NOP_EXPR of class type. Instead, change the /* Don't build a NOP_EXPR of class type. Instead, change the
type of the temporary. Only allow this for cv-qual changes, type of the temporary. Only allow this for cv-qual changes,
though. */ though. */
if (!same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (e)), gcc_assert (same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (e)),
TYPE_MAIN_VARIANT (type))) TYPE_MAIN_VARIANT (type)));
abort ();
TREE_TYPE (e) = TREE_TYPE (TARGET_EXPR_SLOT (e)) = type; TREE_TYPE (e) = TREE_TYPE (TARGET_EXPR_SLOT (e)) = type;
return e; return e;
} }
else if (TREE_ADDRESSABLE (type))
/* We shouldn't be treating objects of ADDRESSABLE type as rvalues. */
abort ();
else else
{
/* We shouldn't be treating objects of ADDRESSABLE type as
rvalues. */
gcc_assert (!TREE_ADDRESSABLE (type));
return fold (build1 (NOP_EXPR, type, e)); return fold (build1 (NOP_EXPR, type, e));
} }
}
if (code == VOID_TYPE && (convtype & CONV_STATIC)) if (code == VOID_TYPE && (convtype & CONV_STATIC))
{ {
......
...@@ -602,18 +602,20 @@ poplevel (int keep, int reverse, int functionbody) ...@@ -602,18 +602,20 @@ poplevel (int keep, int reverse, int functionbody)
} }
else else
{ {
tree name;
/* Remove the binding. */ /* Remove the binding. */
decl = link; decl = link;
if (TREE_CODE (decl) == TREE_LIST) if (TREE_CODE (decl) == TREE_LIST)
decl = TREE_VALUE (decl); decl = TREE_VALUE (decl);
name = decl;
if (DECL_P (decl)) if (TREE_CODE (name) == OVERLOAD)
pop_binding (DECL_NAME (decl), decl); name = OVL_FUNCTION (name);
else if (TREE_CODE (decl) == OVERLOAD)
pop_binding (DECL_NAME (OVL_FUNCTION (decl)), decl); gcc_assert (DECL_P (name));
else pop_binding (DECL_NAME (name), decl);
abort ();
} }
} }
...@@ -2702,8 +2704,7 @@ make_unbound_class_template (tree context, tree name, tsubst_flags_t complain) ...@@ -2702,8 +2704,7 @@ make_unbound_class_template (tree context, tree name, tsubst_flags_t complain)
name = TYPE_IDENTIFIER (name); name = TYPE_IDENTIFIER (name);
else if (DECL_P (name)) else if (DECL_P (name))
name = DECL_NAME (name); name = DECL_NAME (name);
if (TREE_CODE (name) != IDENTIFIER_NODE) gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
abort ();
if (!dependent_type_p (context) if (!dependent_type_p (context)
|| currently_open_class (context)) || currently_open_class (context))
...@@ -4324,7 +4325,7 @@ reshape_init (tree type, tree *initp) ...@@ -4324,7 +4325,7 @@ reshape_init (tree type, tree *initp)
} }
} }
else else
abort (); gcc_unreachable ();
/* The initializers were placed in reverse order in the /* The initializers were placed in reverse order in the
CONSTRUCTOR. */ CONSTRUCTOR. */
...@@ -6258,8 +6259,7 @@ check_special_function_return_type (special_function_kind sfk, ...@@ -6258,8 +6259,7 @@ check_special_function_return_type (special_function_kind sfk,
break; break;
default: default:
abort (); gcc_unreachable ();
break;
} }
return type; return type;
...@@ -6493,7 +6493,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6493,7 +6493,7 @@ grokdeclarator (const cp_declarator *declarator,
break; break;
default: default:
abort (); gcc_unreachable ();
} }
break; break;
...@@ -6507,7 +6507,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6507,7 +6507,7 @@ grokdeclarator (const cp_declarator *declarator,
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
if (id_declarator->kind == cdk_id) if (id_declarator->kind == cdk_id)
...@@ -6982,7 +6982,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -6982,7 +6982,7 @@ grokdeclarator (const cp_declarator *declarator,
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -7236,7 +7236,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7236,7 +7236,7 @@ grokdeclarator (const cp_declarator *declarator,
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -7619,9 +7619,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7619,9 +7619,7 @@ grokdeclarator (const cp_declarator *declarator,
error ("unnamed variable or field declared void"); error ("unnamed variable or field declared void");
else if (TREE_CODE (unqualified_id) == IDENTIFIER_NODE) else if (TREE_CODE (unqualified_id) == IDENTIFIER_NODE)
{ {
if (IDENTIFIER_OPNAME_P (unqualified_id)) gcc_assert (!IDENTIFIER_OPNAME_P (unqualified_id));
abort ();
else
error ("variable or field `%s' declared void", name); error ("variable or field `%s' declared void", name);
} }
else else
...@@ -8524,7 +8522,7 @@ grok_op_properties (tree decl, int friendp, bool complain) ...@@ -8524,7 +8522,7 @@ grok_op_properties (tree decl, int friendp, bool complain)
#include "operators.def" #include "operators.def"
#undef DEF_OPERATOR #undef DEF_OPERATOR
abort (); gcc_unreachable ();
} }
while (0); while (0);
gcc_assert (operator_code != LAST_CPLUS_TREE_CODE); gcc_assert (operator_code != LAST_CPLUS_TREE_CODE);
...@@ -8694,7 +8692,7 @@ grok_op_properties (tree decl, int friendp, bool complain) ...@@ -8694,7 +8692,7 @@ grok_op_properties (tree decl, int friendp, bool complain)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
SET_OVERLOADED_OPERATOR_CODE (decl, operator_code); SET_OVERLOADED_OPERATOR_CODE (decl, operator_code);
...@@ -8825,7 +8823,7 @@ tag_name (enum tag_types code) ...@@ -8825,7 +8823,7 @@ tag_name (enum tag_types code)
case enum_type: case enum_type:
return "enum"; return "enum";
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -8946,7 +8944,7 @@ xref_tag (enum tag_types tag_code, tree name, ...@@ -8946,7 +8944,7 @@ xref_tag (enum tag_types tag_code, tree name,
code = ENUMERAL_TYPE; code = ENUMERAL_TYPE;
break; break;
default: default:
abort (); gcc_unreachable ();
} }
if (! globalize) if (! globalize)
...@@ -9845,8 +9843,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) ...@@ -9845,8 +9843,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
} }
if (DECL_HAS_VTT_PARM_P (decl1)) if (DECL_HAS_VTT_PARM_P (decl1))
{ {
if (DECL_NAME (t) != vtt_parm_identifier) gcc_assert (DECL_NAME (t) == vtt_parm_identifier);
abort ();
current_vtt_parm = t; current_vtt_parm = t;
} }
} }
...@@ -10356,8 +10353,7 @@ finish_function (int flags) ...@@ -10356,8 +10353,7 @@ finish_function (int flags)
if (current_binding_level->kind != sk_function_parms) if (current_binding_level->kind != sk_function_parms)
{ {
/* Make sure we have already experienced errors. */ /* Make sure we have already experienced errors. */
if (errorcount == 0) gcc_assert (errorcount);
abort ();
/* Throw away the broken statement tree and extra binding /* Throw away the broken statement tree and extra binding
levels. */ levels. */
......
...@@ -953,14 +953,14 @@ grokfield (const cp_declarator *declarator, ...@@ -953,14 +953,14 @@ grokfield (const cp_declarator *declarator,
if (attrlist) if (attrlist)
cplus_decl_attributes (&value, attrlist, 0); cplus_decl_attributes (&value, attrlist, 0);
if (TREE_CODE (value) == VAR_DECL) switch (TREE_CODE (value))
{ {
case VAR_DECL:
finish_static_data_member_decl (value, init, asmspec_tree, finish_static_data_member_decl (value, init, asmspec_tree,
flags); flags);
return value; return value;
}
if (TREE_CODE (value) == FIELD_DECL) case FIELD_DECL:
{
if (asmspec) if (asmspec)
error ("`asm' specifiers are not permitted on non-static data members"); error ("`asm' specifiers are not permitted on non-static data members");
if (DECL_INITIAL (value) == error_mark_node) if (DECL_INITIAL (value) == error_mark_node)
...@@ -969,9 +969,8 @@ grokfield (const cp_declarator *declarator, ...@@ -969,9 +969,8 @@ grokfield (const cp_declarator *declarator,
DECL_INITIAL (value) = init; DECL_INITIAL (value) = init;
DECL_IN_AGGR_P (value) = 1; DECL_IN_AGGR_P (value) = 1;
return value; return value;
}
if (TREE_CODE (value) == FUNCTION_DECL) case FUNCTION_DECL:
{
if (asmspec) if (asmspec)
set_user_assembler_name (value, asmspec); set_user_assembler_name (value, asmspec);
if (!DECL_FRIEND_P (value)) if (!DECL_FRIEND_P (value))
...@@ -985,9 +984,10 @@ grokfield (const cp_declarator *declarator, ...@@ -985,9 +984,10 @@ grokfield (const cp_declarator *declarator,
DECL_IN_AGGR_P (value) = 1; DECL_IN_AGGR_P (value) = 1;
return value; return value;
default:
gcc_unreachable ();
} }
abort ();
/* NOTREACHED */
return NULL_TREE; return NULL_TREE;
} }
...@@ -1586,9 +1586,10 @@ maybe_emit_vtables (tree ctype) ...@@ -1586,9 +1586,10 @@ maybe_emit_vtables (tree ctype)
if (TREE_TYPE (DECL_INITIAL (vtbl)) == 0) if (TREE_TYPE (DECL_INITIAL (vtbl)) == 0)
{ {
tree expr = store_init_value (vtbl, DECL_INITIAL (vtbl));
/* It had better be all done at compile-time. */ /* It had better be all done at compile-time. */
if (store_init_value (vtbl, DECL_INITIAL (vtbl))) gcc_assert (!expr);
abort ();
} }
/* Write it out. */ /* Write it out. */
......
...@@ -677,7 +677,7 @@ dump_global_iord (tree t) ...@@ -677,7 +677,7 @@ dump_global_iord (tree t)
else if (DECL_GLOBAL_DTOR_P (t)) else if (DECL_GLOBAL_DTOR_P (t))
p = "destructors"; p = "destructors";
else else
abort (); gcc_unreachable ();
pp_printf (pp_base (cxx_pp), "(static %s for %s)", p, input_filename); pp_printf (pp_base (cxx_pp), "(static %s for %s)", p, input_filename);
} }
...@@ -790,7 +790,7 @@ dump_decl (tree t, int flags) ...@@ -790,7 +790,7 @@ dump_decl (tree t, int flags)
break; break;
case TYPE_EXPR: case TYPE_EXPR:
abort (); gcc_unreachable ();
break; break;
/* These special cases are duplicated here so that other functions /* These special cases are duplicated here so that other functions
...@@ -954,9 +954,9 @@ dump_template_decl (tree t, int flags) ...@@ -954,9 +954,9 @@ dump_template_decl (tree t, int flags)
| (flags & TFF_DECL_SPECIFIERS ? TFF_CLASS_KEY_OR_ENUM : 0))); | (flags & TFF_DECL_SPECIFIERS ? TFF_CLASS_KEY_OR_ENUM : 0)));
else if (TREE_CODE (DECL_TEMPLATE_RESULT (t)) == VAR_DECL) else if (TREE_CODE (DECL_TEMPLATE_RESULT (t)) == VAR_DECL)
dump_decl (DECL_TEMPLATE_RESULT (t), flags | TFF_TEMPLATE_NAME); dump_decl (DECL_TEMPLATE_RESULT (t), flags | TFF_TEMPLATE_NAME);
else if (TREE_TYPE (t) == NULL_TREE)
abort ();
else else
{
gcc_assert (TREE_TYPE (t));
switch (NEXT_CODE (t)) switch (NEXT_CODE (t))
{ {
case METHOD_TYPE: case METHOD_TYPE:
...@@ -967,7 +967,9 @@ dump_template_decl (tree t, int flags) ...@@ -967,7 +967,9 @@ dump_template_decl (tree t, int flags)
/* This case can occur with some invalid code. */ /* This case can occur with some invalid code. */
dump_type (TREE_TYPE (t), dump_type (TREE_TYPE (t),
(flags & ~TFF_CLASS_KEY_OR_ENUM) | TFF_TEMPLATE_NAME (flags & ~TFF_CLASS_KEY_OR_ENUM) | TFF_TEMPLATE_NAME
| (flags & TFF_DECL_SPECIFIERS ? TFF_CLASS_KEY_OR_ENUM : 0)); | (flags & TFF_DECL_SPECIFIERS
? TFF_CLASS_KEY_OR_ENUM : 0));
}
} }
} }
...@@ -2027,9 +2029,9 @@ language_to_string (enum languages c) ...@@ -2027,9 +2029,9 @@ language_to_string (enum languages c)
return "Java"; return "Java";
default: default:
abort (); gcc_unreachable ();
return 0;
} }
return 0;
} }
/* Return the proper printed version of a parameter to a C++ function. */ /* Return the proper printed version of a parameter to a C++ function. */
......
...@@ -312,7 +312,7 @@ choose_personality_routine (enum languages lang) ...@@ -312,7 +312,7 @@ choose_personality_routine (enum languages lang)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
return; return;
......
...@@ -337,8 +337,7 @@ do_friend (tree ctype, tree declarator, tree decl, ...@@ -337,8 +337,7 @@ do_friend (tree ctype, tree declarator, tree decl,
declarator = DECL_NAME (get_first_fn (declarator)); declarator = DECL_NAME (get_first_fn (declarator));
} }
if (TREE_CODE (decl) != FUNCTION_DECL) gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
abort ();
if (ctype) if (ctype)
{ {
......
...@@ -293,7 +293,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv, ...@@ -293,7 +293,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
arglist[j++] = "-xc++-header"; arglist[j++] = "-xc++-header";
break; break;
default: default:
abort (); gcc_unreachable ();
} }
arglist[j++] = argv[i]; arglist[j++] = argv[i];
arglist[j] = "-xnone"; arglist[j] = "-xnone";
......
...@@ -240,10 +240,8 @@ build_zero_init (tree type, tree nelts, bool static_storage_p) ...@@ -240,10 +240,8 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
inits); inits);
CONSTRUCTOR_ELTS (init) = nreverse (inits); CONSTRUCTOR_ELTS (init) = nreverse (inits);
} }
else if (TREE_CODE (type) == REFERENCE_TYPE)
;
else else
abort (); gcc_assert (TREE_CODE (type) == REFERENCE_TYPE);
/* In all cases, the initializer is a constant. */ /* In all cases, the initializer is a constant. */
if (init) if (init)
...@@ -1166,8 +1164,7 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags) ...@@ -1166,8 +1164,7 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags)
&& (flags & LOOKUP_ONLYCONVERTING)) && (flags & LOOKUP_ONLYCONVERTING))
{ {
/* Base subobjects should only get direct-initialization. */ /* Base subobjects should only get direct-initialization. */
if (true_exp != exp) gcc_assert (true_exp == exp);
abort ();
if (flags & DIRECT_BIND) if (flags & DIRECT_BIND)
/* Do nothing. We hit this in two cases: Reference initialization, /* Do nothing. We hit this in two cases: Reference initialization,
...@@ -2073,9 +2070,9 @@ build_new_1 (tree exp) ...@@ -2073,9 +2070,9 @@ build_new_1 (tree exp)
if (TREE_CODE (init) == TREE_LIST) if (TREE_CODE (init) == TREE_LIST)
init = build_x_compound_expr_from_list (init, "new initializer"); init = build_x_compound_expr_from_list (init, "new initializer");
else if (TREE_CODE (init) == CONSTRUCTOR else
&& TREE_TYPE (init) == NULL_TREE) gcc_assert (TREE_CODE (init) != CONSTRUCTOR
abort (); || TREE_TYPE (init) != NULL_TREE);
init_expr = build_modify_expr (init_expr, INIT_EXPR, init); init_expr = build_modify_expr (init_expr, INIT_EXPR, init);
stable = stabilize_init (init_expr, &init_preeval_expr); stable = stabilize_init (init_expr, &init_preeval_expr);
...@@ -2217,8 +2214,7 @@ build_vec_delete_1 (tree base, tree maxindex, tree type, ...@@ -2217,8 +2214,7 @@ build_vec_delete_1 (tree base, tree maxindex, tree type,
tree controller = NULL_TREE; tree controller = NULL_TREE;
/* We should only have 1-D arrays here. */ /* We should only have 1-D arrays here. */
if (TREE_CODE (type) == ARRAY_TYPE) gcc_assert (TREE_CODE (type) != ARRAY_TYPE);
abort ();
if (! IS_AGGR_TYPE (type) || TYPE_HAS_TRIVIAL_DESTRUCTOR (type)) if (! IS_AGGR_TYPE (type) || TYPE_HAS_TRIVIAL_DESTRUCTOR (type))
goto no_destructor; goto no_destructor;
...@@ -2560,7 +2556,7 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array) ...@@ -2560,7 +2556,7 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
else if (from) else if (from)
elt_init = build_modify_expr (to, NOP_EXPR, from); elt_init = build_modify_expr (to, NOP_EXPR, from);
else else
abort (); gcc_unreachable ();
} }
else if (TREE_CODE (type) == ARRAY_TYPE) else if (TREE_CODE (type) == ARRAY_TYPE)
{ {
...@@ -2670,7 +2666,7 @@ build_dtor_call (tree exp, special_function_kind dtor_kind, int flags) ...@@ -2670,7 +2666,7 @@ build_dtor_call (tree exp, special_function_kind dtor_kind, int flags)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
exp = convert_from_reference (exp); exp = convert_from_reference (exp);
......
...@@ -687,7 +687,8 @@ retrofit_lang_decl (tree t) ...@@ -687,7 +687,8 @@ retrofit_lang_decl (tree t)
SET_DECL_LANGUAGE (t, lang_c); SET_DECL_LANGUAGE (t, lang_c);
else if (current_lang_name == lang_name_java) else if (current_lang_name == lang_name_java)
SET_DECL_LANGUAGE (t, lang_java); SET_DECL_LANGUAGE (t, lang_java);
else abort (); else
gcc_unreachable ();
#ifdef GATHER_STATISTICS #ifdef GATHER_STATISTICS
tree_node_counts[(int)lang_decl] += 1; tree_node_counts[(int)lang_decl] += 1;
...@@ -826,6 +827,6 @@ cp_type_qual_from_rid (tree rid) ...@@ -826,6 +827,6 @@ cp_type_qual_from_rid (tree rid)
else if (rid == ridpointers[(int) RID_RESTRICT]) else if (rid == ridpointers[(int) RID_RESTRICT])
return TYPE_QUAL_RESTRICT; return TYPE_QUAL_RESTRICT;
abort (); gcc_unreachable ();
return TYPE_UNQUALIFIED; return TYPE_UNQUALIFIED;
} }
...@@ -373,12 +373,10 @@ add_substitution (tree node) ...@@ -373,12 +373,10 @@ add_substitution (tree node)
for (i = VARRAY_ACTIVE_SIZE (G.substitutions); --i >= 0; ) for (i = VARRAY_ACTIVE_SIZE (G.substitutions); --i >= 0; )
{ {
const tree candidate = VARRAY_TREE (G.substitutions, i); const tree candidate = VARRAY_TREE (G.substitutions, i);
if ((DECL_P (node)
&& node == candidate) gcc_assert (!(DECL_P (node) && node == candidate));
|| (TYPE_P (node) gcc_assert (!(TYPE_P (node) && TYPE_P (candidate)
&& TYPE_P (candidate) && same_type_p (node, candidate)));
&& same_type_p (node, candidate)))
abort ();
} }
} }
#endif /* ENABLE_CHECKING */ #endif /* ENABLE_CHECKING */
...@@ -832,14 +830,16 @@ write_unscoped_name (const tree decl) ...@@ -832,14 +830,16 @@ write_unscoped_name (const tree decl)
write_string ("St"); write_string ("St");
write_unqualified_name (decl); write_unqualified_name (decl);
} }
else
{
/* If not, it should be either in the global namespace, or directly /* If not, it should be either in the global namespace, or directly
in a local function scope. */ in a local function scope. */
else if (context == global_namespace gcc_assert (context == global_namespace
|| context == NULL || context == NULL
|| TREE_CODE (context) == FUNCTION_DECL) || TREE_CODE (context) == FUNCTION_DECL);
write_unqualified_name (decl); write_unqualified_name (decl);
else }
abort ();
} }
/* <unscoped-template-name> ::= <unscoped-name> /* <unscoped-template-name> ::= <unscoped-name>
...@@ -984,11 +984,12 @@ write_template_prefix (const tree node) ...@@ -984,11 +984,12 @@ write_template_prefix (const tree node)
/* Find the template decl. */ /* Find the template decl. */
if (decl_is_template_id (decl, &template_info)) if (decl_is_template_id (decl, &template_info))
template = TI_TEMPLATE (template_info); template = TI_TEMPLATE (template_info);
else if (CLASSTYPE_TEMPLATE_ID_P (type))
template = TYPE_TI_TEMPLATE (type);
else else
/* Oops, not a template. */ {
abort (); gcc_assert (CLASSTYPE_TEMPLATE_ID_P (type));
template = TYPE_TI_TEMPLATE (type);
}
/* For a member template, though, the template name for the /* For a member template, though, the template name for the
innermost name must have all the outer template levels innermost name must have all the outer template levels
...@@ -1325,16 +1326,18 @@ write_identifier (const char *identifier) ...@@ -1325,16 +1326,18 @@ write_identifier (const char *identifier)
static void static void
write_special_name_constructor (const tree ctor) write_special_name_constructor (const tree ctor)
{ {
if (DECL_COMPLETE_CONSTRUCTOR_P (ctor) if (DECL_BASE_CONSTRUCTOR_P (ctor))
/* Even though we don't ever emit a definition of the
old-style destructor, we still have to consider entities
(like static variables) nested inside it. */
|| DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (ctor))
write_string ("C1");
else if (DECL_BASE_CONSTRUCTOR_P (ctor))
write_string ("C2"); write_string ("C2");
else else
abort (); {
gcc_assert (DECL_COMPLETE_CONSTRUCTOR_P (ctor)
/* Even though we don't ever emit a definition of
the old-style destructor, we still have to
consider entities (like static variables) nested
inside it. */
|| DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (ctor));
write_string ("C1");
}
} }
/* Handle destructor productions of non-terminal <special-name>. /* Handle destructor productions of non-terminal <special-name>.
...@@ -1353,16 +1356,18 @@ write_special_name_destructor (const tree dtor) ...@@ -1353,16 +1356,18 @@ write_special_name_destructor (const tree dtor)
{ {
if (DECL_DELETING_DESTRUCTOR_P (dtor)) if (DECL_DELETING_DESTRUCTOR_P (dtor))
write_string ("D0"); write_string ("D0");
else if (DECL_COMPLETE_DESTRUCTOR_P (dtor)
/* Even though we don't ever emit a definition of the
old-style destructor, we still have to consider entities
(like static variables) nested inside it. */
|| DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (dtor))
write_string ("D1");
else if (DECL_BASE_DESTRUCTOR_P (dtor)) else if (DECL_BASE_DESTRUCTOR_P (dtor))
write_string ("D2"); write_string ("D2");
else else
abort (); {
gcc_assert (DECL_COMPLETE_DESTRUCTOR_P (dtor)
/* Even though we don't ever emit a definition of
the old-style destructor, we still have to
consider entities (like static variables) nested
inside it. */
|| DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (dtor));
write_string ("D1");
}
} }
/* Return the discriminator for ENTITY appearing inside /* Return the discriminator for ENTITY appearing inside
...@@ -1590,7 +1595,7 @@ write_type (tree type) ...@@ -1590,7 +1595,7 @@ write_type (tree type)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -1706,11 +1711,8 @@ write_builtin_type (tree type) ...@@ -1706,11 +1711,8 @@ write_builtin_type (tree type)
TYPE_UNSIGNED (type)); TYPE_UNSIGNED (type));
if (type == t) if (type == t)
{ {
if (TYPE_PRECISION (type) == 128) gcc_assert (TYPE_PRECISION (type) == 128);
write_char (TYPE_UNSIGNED (type) ? 'o' : 'n'); write_char (TYPE_UNSIGNED (type) ? 'o' : 'n');
else
/* Couldn't find this type. */
abort ();
} }
else else
{ {
...@@ -1731,11 +1733,11 @@ write_builtin_type (tree type) ...@@ -1731,11 +1733,11 @@ write_builtin_type (tree type)
else if (type == long_double_type_node) else if (type == long_double_type_node)
write_char ('e'); write_char ('e');
else else
abort (); gcc_unreachable ();
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -2139,30 +2141,28 @@ write_expression (tree expr) ...@@ -2139,30 +2141,28 @@ write_expression (tree expr)
static void static void
write_template_arg_literal (const tree value) write_template_arg_literal (const tree value)
{ {
tree type = TREE_TYPE (value);
write_char ('L'); write_char ('L');
write_type (type); write_type (TREE_TYPE (value));
if (TREE_CODE (value) == CONST_DECL) switch (TREE_CODE (value))
write_integer_cst (DECL_INITIAL (value));
else if (TREE_CODE (value) == INTEGER_CST)
{
if (same_type_p (type, boolean_type_node))
{ {
if (integer_zerop (value)) case CONST_DECL:
write_unsigned_number (0); write_integer_cst (DECL_INITIAL (value));
else if (integer_onep (value)) break;
write_unsigned_number (1);
else case INTEGER_CST:
abort (); gcc_assert (!same_type_p (TREE_TYPE (value), boolean_type_node)
} || integer_zerop (value) || integer_onep (value));
else
write_integer_cst (value); write_integer_cst (value);
} break;
else if (TREE_CODE (value) == REAL_CST)
case REAL_CST:
write_real_cst (value); write_real_cst (value);
else break;
abort ();
default:
gcc_unreachable ();
}
write_char ('E'); write_char ('E');
} }
...@@ -2352,7 +2352,7 @@ write_template_param (const tree parm) ...@@ -2352,7 +2352,7 @@ write_template_param (const tree parm)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
write_char ('T'); write_char ('T');
...@@ -2803,7 +2803,7 @@ write_java_integer_type_codes (const tree type) ...@@ -2803,7 +2803,7 @@ write_java_integer_type_codes (const tree type)
else if (type == java_boolean_type_node) else if (type == java_boolean_type_node)
write_char ('b'); write_char ('b');
else else
abort (); gcc_unreachable ();
} }
#include "gt-cp-mangle.h" #include "gt-cp-mangle.h"
...@@ -989,7 +989,7 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p) ...@@ -989,7 +989,7 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p)
break; break;
} }
default: default:
abort (); gcc_unreachable ();
} }
/* Create the function. */ /* Create the function. */
...@@ -1028,8 +1028,7 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p) ...@@ -1028,8 +1028,7 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p)
DECL_NOT_REALLY_EXTERN (fn) = 1; DECL_NOT_REALLY_EXTERN (fn) = 1;
DECL_DECLARED_INLINE_P (fn) = 1; DECL_DECLARED_INLINE_P (fn) = 1;
DECL_INLINE (fn) = 1; DECL_INLINE (fn) = 1;
if (TREE_USED (fn)) gcc_assert (!TREE_USED (fn));
abort ();
return fn; return fn;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment