summaryrefslogtreecommitdiff
path: root/gcc/cp/cvt.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-30 15:28:48 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-30 15:28:48 +0000
commit092b1d6f29c36a1496c539d276bc9d0e1ce66082 (patch)
tree4ca6b4e112f696c8ceed5ba25d4dd59e1b129aba /gcc/cp/cvt.c
parentd6e1a335bca7a6d63ada7dedc95671be86e1a1fe (diff)
downloadgcc-092b1d6f29c36a1496c539d276bc9d0e1ce66082.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86778 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r--gcc/cp/cvt.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index ed18d7c53f7..cb179d55ab2 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -284,12 +284,12 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
if (TYPE_PRECISION (intype) == POINTER_SIZE)
return build1 (CONVERT_EXPR, type, expr);
expr = cp_convert (c_common_type_for_size (POINTER_SIZE, 0), expr);
- /* Modes may be different but sizes should be the same. */
- if (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr)))
- != GET_MODE_SIZE (TYPE_MODE (type)))
- /* There is supposed to be some integral type
- that is the same width as a pointer. */
- abort ();
+ /* Modes may be different but sizes should be the same. There
+ is supposed to be some integral type that is the same width
+ as a pointer. */
+ gcc_assert (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr)))
+ == GET_MODE_SIZE (TYPE_MODE (type)));
+
return convert_to_pointer (type, expr);
}
@@ -647,17 +647,18 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
/* Don't build a NOP_EXPR of class type. Instead, change the
type of the temporary. Only allow this for cv-qual changes,
though. */
- if (!same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (e)),
- TYPE_MAIN_VARIANT (type)))
- abort ();
+ gcc_assert (same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (e)),
+ TYPE_MAIN_VARIANT (type)));
TREE_TYPE (e) = TREE_TYPE (TARGET_EXPR_SLOT (e)) = type;
return e;
}
- else if (TREE_ADDRESSABLE (type))
- /* We shouldn't be treating objects of ADDRESSABLE type as rvalues. */
- abort ();
else
- return fold (build1 (NOP_EXPR, type, e));
+ {
+ /* We shouldn't be treating objects of ADDRESSABLE type as
+ rvalues. */
+ gcc_assert (!TREE_ADDRESSABLE (type));
+ return fold (build1 (NOP_EXPR, type, e));
+ }
}
if (code == VOID_TYPE && (convtype & CONV_STATIC))