Commit ab184b2a by Ben Elliston Committed by Ben Elliston

java-gimplify.c: Use gcc_assert and gcc_unreachable throughout.

	* java-gimplify.c: Use gcc_assert and gcc_unreachable throughout.
	* typeck.c: Likewise.
	* verify-impl.c: Likewise.
	* class.c: Likewise.
	* decl.c: Likewise.
	* jcf-parse.c: Likewise.
	* constants.c: Likewise.
	* check-init.c: Likewise.
	* jcf-write.c: Likewise.
	* verify-glue.c: Likewise.
	* mangle.c: Likewise.
	* expr.c: Likewise.
	* lang.c: Likewise.
	* boehm.c: Likewise.

From-SVN: r110541
parent 4a6c754b
2006-02-03 Ben Elliston <bje@au.ibm.com>
* java-gimplify.c: Use gcc_assert and gcc_unreachable throughout.
* typeck.c: Likewise.
* verify-impl.c: Likewise.
* class.c: Likewise.
* decl.c: Likewise.
* jcf-parse.c: Likewise.
* constants.c: Likewise.
* check-init.c: Likewise.
* jcf-write.c: Likewise.
* verify-glue.c: Likewise.
* mangle.c: Likewise.
* expr.c: Likewise.
* lang.c: Likewise.
* boehm.c: Likewise.
2006-02-01 Jan Hubicka <jh@suse.cz> 2006-02-01 Jan Hubicka <jh@suse.cz>
* decl.c (end_java_method): Kill hack disabling unit-at-a-time. * decl.c (end_java_method): Kill hack disabling unit-at-a-time.
......
...@@ -101,8 +101,7 @@ mark_reference_fields (tree field, ...@@ -101,8 +101,7 @@ mark_reference_fields (tree field,
/* If this reference slot appears to overlay a slot we think /* If this reference slot appears to overlay a slot we think
we already covered, then we are doomed. */ we already covered, then we are doomed. */
if (offset <= *last_view_index) gcc_assert (offset > *last_view_index);
abort ();
count = offset * BITS_PER_UNIT / POINTER_SIZE; count = offset * BITS_PER_UNIT / POINTER_SIZE;
size_words = size_bytes * BITS_PER_UNIT / POINTER_SIZE; size_words = size_bytes * BITS_PER_UNIT / POINTER_SIZE;
......
...@@ -672,8 +672,7 @@ check_init (tree exp, words before) ...@@ -672,8 +672,7 @@ check_init (tree exp, words before)
DECLARE_BUFFERS(when_true, 2); DECLARE_BUFFERS(when_true, 2);
words when_false = when_true + num_current_words; words when_false = when_true + num_current_words;
#ifdef ENABLE_JC1_CHECKING #ifdef ENABLE_JC1_CHECKING
if (TREE_CODE (alt->block) != LOOP_EXPR) gcc_assert (TREE_CODE (alt->block) == LOOP_EXPR);
abort ();
#endif #endif
check_bool_init (TREE_OPERAND (exp, 0), before, when_false, when_true); check_bool_init (TREE_OPERAND (exp, 0), before, when_false, when_true);
done_alternative (when_true, alt); done_alternative (when_true, alt);
......
...@@ -1014,7 +1014,7 @@ build_class_ref (tree type) ...@@ -1014,7 +1014,7 @@ build_class_ref (tree type)
else if (type == void_type_node) else if (type == void_type_node)
prim_class_name = "java.lang.Void"; prim_class_name = "java.lang.Void";
else else
abort (); gcc_unreachable ();
prim_class = lookup_class (get_identifier (prim_class_name)); prim_class = lookup_class (get_identifier (prim_class_name));
/* We wrap the class in a NOP_EXPR, because it is a /* We wrap the class in a NOP_EXPR, because it is a
...@@ -1207,7 +1207,7 @@ get_access_flags_from_decl (tree decl) ...@@ -1207,7 +1207,7 @@ get_access_flags_from_decl (tree decl)
access_flags |= ACC_INVISIBLE; access_flags |= ACC_INVISIBLE;
return access_flags; return access_flags;
} }
abort (); gcc_unreachable ();
} }
static GTY (()) int alias_labelno = 0; static GTY (()) int alias_labelno = 0;
...@@ -2313,8 +2313,7 @@ get_interface_method_index (tree method, tree interface) ...@@ -2313,8 +2313,7 @@ get_interface_method_index (tree method, tree interface)
{ {
if (meth == method) if (meth == method)
return i; return i;
if (meth == NULL_TREE) gcc_assert (meth != NULL_TREE);
abort ();
} }
} }
......
...@@ -313,8 +313,7 @@ write_constant_pool (CPool *cpool, unsigned char *buffer, int length) ...@@ -313,8 +313,7 @@ write_constant_pool (CPool *cpool, unsigned char *buffer, int length)
} }
} }
if (ptr != buffer + length) gcc_assert (ptr == buffer + length);
abort ();
} }
static GTY(()) tree tag_nodes[13]; static GTY(()) tree tag_nodes[13];
......
...@@ -163,8 +163,7 @@ update_aliases (tree decl, int index, int pc) ...@@ -163,8 +163,7 @@ update_aliases (tree decl, int index, int pc)
tree decl_type = TREE_TYPE (decl); tree decl_type = TREE_TYPE (decl);
tree tmp; tree tmp;
if (debug_variable_p (decl)) gcc_assert (! debug_variable_p (decl));
abort ();
for (tmp = TREE_VEC_ELT (decl_map, index); for (tmp = TREE_VEC_ELT (decl_map, index);
tmp != NULL_TREE; tmp != NULL_TREE;
...@@ -188,8 +187,7 @@ update_aliases (tree decl, int index, int pc) ...@@ -188,8 +187,7 @@ update_aliases (tree decl, int index, int pc)
&& TREE_CODE (decl_type) == POINTER_TYPE))) && TREE_CODE (decl_type) == POINTER_TYPE)))
{ {
tree src = build1 (NOP_EXPR, tmp_type, decl); tree src = build1 (NOP_EXPR, tmp_type, decl);
if (LOCAL_VAR_OUT_OF_SCOPE_P (tmp)) gcc_assert (! LOCAL_VAR_OUT_OF_SCOPE_P (tmp));
abort ();
java_add_stmt (build2 (MODIFY_EXPR, tmp_type, tmp, src)); java_add_stmt (build2 (MODIFY_EXPR, tmp_type, tmp, src));
} }
} }
...@@ -269,8 +267,7 @@ check_local_unnamed_variable (tree best, tree decl, tree type) ...@@ -269,8 +267,7 @@ check_local_unnamed_variable (tree best, tree decl, tree type)
{ {
tree decl_type = TREE_TYPE (decl); tree decl_type = TREE_TYPE (decl);
if (LOCAL_VAR_OUT_OF_SCOPE_P (decl)) gcc_assert (! LOCAL_VAR_OUT_OF_SCOPE_P (decl));
abort ();
/* Use the same decl for all integer types <= 32 bits. This is /* Use the same decl for all integer types <= 32 bits. This is
necessary because sometimes a value is stored as (for example) necessary because sometimes a value is stored as (for example)
...@@ -411,9 +408,7 @@ java_replace_reference (tree var_decl, bool want_lvalue) ...@@ -411,9 +408,7 @@ java_replace_reference (tree var_decl, bool want_lvalue)
int index = DECL_LOCAL_SLOT_NUMBER (var_decl); int index = DECL_LOCAL_SLOT_NUMBER (var_decl);
tree base_decl = TREE_VEC_ELT (base_decl_map, index); tree base_decl = TREE_VEC_ELT (base_decl_map, index);
if (! base_decl) gcc_assert (base_decl);
abort ();
if (! want_lvalue) if (! want_lvalue)
base_decl = build1 (NOP_EXPR, decl_type, base_decl); base_decl = build1 (NOP_EXPR, decl_type, base_decl);
...@@ -2010,8 +2005,7 @@ start_java_method (tree fndecl) ...@@ -2010,8 +2005,7 @@ start_java_method (tree fndecl)
{ {
tree parm_name = NULL_TREE, parm_decl; tree parm_name = NULL_TREE, parm_decl;
tree parm_type = TREE_VALUE (tem); tree parm_type = TREE_VALUE (tem);
if (i >= DECL_MAX_LOCALS (fndecl)) gcc_assert (i < DECL_MAX_LOCALS (fndecl));
abort ();
parm_decl = build_decl (PARM_DECL, parm_name, parm_type); parm_decl = build_decl (PARM_DECL, parm_name, parm_type);
DECL_CONTEXT (parm_decl) = fndecl; DECL_CONTEXT (parm_decl) = fndecl;
...@@ -2277,8 +2271,7 @@ get_stmts (void) ...@@ -2277,8 +2271,7 @@ get_stmts (void)
void void
register_exception_range (struct eh_range *range, int pc, int end_pc) register_exception_range (struct eh_range *range, int pc, int end_pc)
{ {
if (current_binding_level->exception_range) gcc_assert (! current_binding_level->exception_range);
abort ();
current_binding_level->exception_range = range; current_binding_level->exception_range = range;
current_binding_level->end_pc = end_pc; current_binding_level->end_pc = end_pc;
current_binding_level->start_pc = pc; current_binding_level->start_pc = pc;
......
...@@ -273,8 +273,7 @@ push_type_0 (tree type) ...@@ -273,8 +273,7 @@ push_type_0 (tree type)
void void
push_type (tree type) push_type (tree type)
{ {
if (! push_type_0 (type)) gcc_assert (push_type_0 (type));
abort ();
} }
static void static void
...@@ -606,15 +605,13 @@ java_stack_pop (int count) ...@@ -606,15 +605,13 @@ java_stack_pop (int count)
{ {
tree type, val; tree type, val;
if (stack_pointer == 0) gcc_assert (stack_pointer != 0);
abort ();
type = stack_type_map[stack_pointer - 1]; type = stack_type_map[stack_pointer - 1];
if (type == TYPE_SECOND) if (type == TYPE_SECOND)
{ {
count--; count--;
if (stack_pointer == 1 || count <= 0) gcc_assert (stack_pointer != 1 && count > 0);
abort ();
type = stack_type_map[stack_pointer - 2]; type = stack_type_map[stack_pointer - 2];
} }
...@@ -632,13 +629,12 @@ java_stack_swap (void) ...@@ -632,13 +629,12 @@ java_stack_swap (void)
tree temp; tree temp;
tree decl1, decl2; tree decl1, decl2;
if (stack_pointer < 2 /* Bad stack swap. */
|| (type1 = stack_type_map[stack_pointer - 1]) == TYPE_UNKNOWN gcc_assert (stack_pointer >= 2
|| (type2 = stack_type_map[stack_pointer - 2]) == TYPE_UNKNOWN && (type1 = stack_type_map[stack_pointer - 1]) != TYPE_UNKNOWN
|| type1 == TYPE_SECOND || type2 == TYPE_SECOND && (type2 = stack_type_map[stack_pointer - 2]) != TYPE_UNKNOWN
|| TYPE_IS_WIDE (type1) || TYPE_IS_WIDE (type2)) && (type1 != TYPE_SECOND && type2 != TYPE_SECOND)
/* Bad stack swap. */ && (! TYPE_IS_WIDE (type1) && ! TYPE_IS_WIDE (type2)));
abort ();
flush_quick_stack (); flush_quick_stack ();
decl1 = find_stack_slot (stack_pointer - 1, type1); decl1 = find_stack_slot (stack_pointer - 1, type1);
...@@ -678,18 +674,16 @@ java_stack_dup (int size, int offset) ...@@ -678,18 +674,16 @@ java_stack_dup (int size, int offset)
type = stack_type_map [src_index]; type = stack_type_map [src_index];
if (type == TYPE_SECOND) if (type == TYPE_SECOND)
{ {
if (src_index <= low_index) /* Dup operation splits 64-bit number. */
/* Dup operation splits 64-bit number. */ gcc_assert (src_index > low_index);
abort ();
stack_type_map[dst_index] = type; stack_type_map[dst_index] = type;
src_index--; dst_index--; src_index--; dst_index--;
type = stack_type_map[src_index]; type = stack_type_map[src_index];
if (! TYPE_IS_WIDE (type)) gcc_assert (TYPE_IS_WIDE (type));
abort ();
} }
else if (TYPE_IS_WIDE (type)) else
abort (); gcc_assert (! TYPE_IS_WIDE (type));
if (src_index != dst_index) if (src_index != dst_index)
{ {
...@@ -785,7 +779,7 @@ encode_newarray_type (tree type) ...@@ -785,7 +779,7 @@ encode_newarray_type (tree type)
else if (type == long_type_node) else if (type == long_type_node)
return 11; return 11;
else else
abort (); gcc_unreachable ();
} }
/* Build a call to _Jv_ThrowBadArrayIndex(), the /* Build a call to _Jv_ThrowBadArrayIndex(), the
...@@ -942,17 +936,15 @@ build_java_arraystore_check (tree array, tree object) ...@@ -942,17 +936,15 @@ build_java_arraystore_check (tree array, tree object)
} }
else else
{ {
if (! is_array_type_p (array_type_p)) gcc_assert (is_array_type_p (array_type_p));
abort ();
/* Get the TYPE_DECL for ARRAY's element type. */ /* Get the TYPE_DECL for ARRAY's element type. */
element_type element_type
= TYPE_NAME (TREE_TYPE (TREE_TYPE (TREE_TYPE (array_type_p)))); = TYPE_NAME (TREE_TYPE (TREE_TYPE (TREE_TYPE (array_type_p))));
} }
if (TREE_CODE (element_type) != TYPE_DECL gcc_assert (TREE_CODE (element_type) == TYPE_DECL
|| TREE_CODE (object_type) != TYPE_DECL) && TREE_CODE (object_type) == TYPE_DECL);
abort ();
if (!flag_store_check) if (!flag_store_check)
return build1 (NOP_EXPR, array_type_p, array); return build1 (NOP_EXPR, array_type_p, array);
...@@ -1235,7 +1227,7 @@ expand_java_pushc (int ival, tree type) ...@@ -1235,7 +1227,7 @@ expand_java_pushc (int ival, tree type)
value = build_real (type, x); value = build_real (type, x);
} }
else else
abort (); gcc_unreachable ();
push_value (value); push_value (value);
} }
...@@ -1492,9 +1484,7 @@ build_java_soft_divmod (enum tree_code op, tree type, tree op1, tree op2) ...@@ -1492,9 +1484,7 @@ build_java_soft_divmod (enum tree_code op, tree type, tree op1, tree op2)
} }
} }
if (! call) gcc_assert (call);
abort ();
call = build3 (CALL_EXPR, type, call = build3 (CALL_EXPR, type,
build_address_of (call), build_address_of (call),
tree_cons (NULL_TREE, arg1, tree_cons (NULL_TREE, arg1,
...@@ -1890,7 +1880,7 @@ pop_arguments (tree arg_types) ...@@ -1890,7 +1880,7 @@ pop_arguments (tree arg_types)
arg = convert (integer_type_node, arg); arg = convert (integer_type_node, arg);
return tree_cons (NULL_TREE, arg, tail); return tree_cons (NULL_TREE, arg, tail);
} }
abort (); gcc_unreachable ();
} }
/* Attach to PTR (a block) the declaration found in ENTRY. */ /* Attach to PTR (a block) the declaration found in ENTRY. */
...@@ -2151,8 +2141,7 @@ build_invokevirtual (tree dtable, tree method) ...@@ -2151,8 +2141,7 @@ build_invokevirtual (tree dtable, tree method)
if (flag_indirect_dispatch) if (flag_indirect_dispatch)
{ {
if (CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (method)))) gcc_assert (! CLASS_INTERFACE (TYPE_NAME (DECL_CONTEXT (method))));
abort ();
otable_index otable_index
= build_int_cst (NULL_TREE, get_symbol_table_index = build_int_cst (NULL_TREE, get_symbol_table_index
...@@ -2205,8 +2194,7 @@ build_invokeinterface (tree dtable, tree method) ...@@ -2205,8 +2194,7 @@ build_invokeinterface (tree dtable, tree method)
lookup_field (&dtable_type, class_ident), NULL_TREE); lookup_field (&dtable_type, class_ident), NULL_TREE);
interface = DECL_CONTEXT (method); interface = DECL_CONTEXT (method);
if (! CLASS_INTERFACE (TYPE_NAME (interface))) gcc_assert (CLASS_INTERFACE (TYPE_NAME (interface)));
abort ();
layout_class_methods (interface); layout_class_methods (interface);
if (flag_indirect_dispatch) if (flag_indirect_dispatch)
...@@ -2447,8 +2435,7 @@ build_jni_stub (tree method) ...@@ -2447,8 +2435,7 @@ build_jni_stub (tree method)
int from_class = ! CLASS_FROM_SOURCE_P (klass); int from_class = ! CLASS_FROM_SOURCE_P (klass);
klass = build_class_ref (klass); klass = build_class_ref (klass);
if (! METHOD_NATIVE (method) || ! flag_jni) gcc_assert (METHOD_NATIVE (method) && flag_jni);
abort ();
DECL_ARTIFICIAL (method) = 1; DECL_ARTIFICIAL (method) = 1;
DECL_EXTERNAL (method) = 0; DECL_EXTERNAL (method) = 0;
...@@ -2602,8 +2589,7 @@ build_jni_stub (tree method) ...@@ -2602,8 +2589,7 @@ build_jni_stub (tree method)
if (res_var != NULL_TREE) if (res_var != NULL_TREE)
{ {
tree drt; tree drt;
if (! DECL_RESULT (method)) gcc_assert (DECL_RESULT (method));
abort ();
/* Make sure we copy the result variable to the actual /* Make sure we copy the result variable to the actual
result. We use the type of the DECL_RESULT because it result. We use the type of the DECL_RESULT because it
might be different from the return type of the function: might be different from the return type of the function:
...@@ -3482,8 +3468,7 @@ force_evaluation_order (tree node) ...@@ -3482,8 +3468,7 @@ force_evaluation_order (tree node)
return node; return node;
/* Not having a list of arguments here is an error. */ /* Not having a list of arguments here is an error. */
if (TREE_CODE (arg) != TREE_LIST) gcc_assert (TREE_CODE (arg) == TREE_LIST);
abort ();
/* This reverses the evaluation order. This is a desired effect. */ /* This reverses the evaluation order. This is a desired effect. */
for (cmp = NULL_TREE; arg; arg = TREE_CHAIN (arg)) for (cmp = NULL_TREE; arg; arg = TREE_CHAIN (arg))
......
...@@ -146,7 +146,7 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED, ...@@ -146,7 +146,7 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
case CONDITIONAL_EXPR: case CONDITIONAL_EXPR:
case INSTANCEOF_EXPR: case INSTANCEOF_EXPR:
case CLASS_LITERAL: case CLASS_LITERAL:
abort (); gcc_unreachable ();
default: default:
/* Java insists on strict left-to-right evaluation of expressions. /* Java insists on strict left-to-right evaluation of expressions.
......
...@@ -120,7 +120,7 @@ handle_deprecated (void) ...@@ -120,7 +120,7 @@ handle_deprecated (void)
else else
{ {
/* Shouldn't happen. */ /* Shouldn't happen. */
abort (); gcc_unreachable ();
} }
} }
...@@ -285,12 +285,12 @@ set_source_filename (JCF *jcf, int index) ...@@ -285,12 +285,12 @@ set_source_filename (JCF *jcf, int index)
tree tree
parse_signature (JCF *jcf, int sig_index) parse_signature (JCF *jcf, int sig_index)
{ {
if (sig_index <= 0 || sig_index >= JPOOL_SIZE (jcf) gcc_assert (sig_index > 0
|| JPOOL_TAG (jcf, sig_index) != CONSTANT_Utf8) && sig_index < JPOOL_SIZE (jcf)
abort (); && JPOOL_TAG (jcf, sig_index) == CONSTANT_Utf8);
else
return parse_signature_string (JPOOL_UTF_DATA (jcf, sig_index), return parse_signature_string (JPOOL_UTF_DATA (jcf, sig_index),
JPOOL_UTF_LENGTH (jcf, sig_index)); JPOOL_UTF_LENGTH (jcf, sig_index));
} }
tree tree
...@@ -395,10 +395,7 @@ tree ...@@ -395,10 +395,7 @@ tree
get_name_constant (JCF *jcf, int index) get_name_constant (JCF *jcf, int index)
{ {
tree name = get_constant (jcf, index); tree name = get_constant (jcf, index);
gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
if (TREE_CODE (name) != IDENTIFIER_NODE)
abort ();
return name; return name;
} }
...@@ -445,10 +442,10 @@ handle_innerclass_attribute (int count, JCF *jcf) ...@@ -445,10 +442,10 @@ handle_innerclass_attribute (int count, JCF *jcf)
static tree static tree
give_name_to_class (JCF *jcf, int i) give_name_to_class (JCF *jcf, int i)
{ {
if (i <= 0 || i >= JPOOL_SIZE (jcf) gcc_assert (i > 0
|| JPOOL_TAG (jcf, i) != CONSTANT_Class) && i < JPOOL_SIZE (jcf)
abort (); && JPOOL_TAG (jcf, i) == CONSTANT_Class);
else
{ {
tree package_name = NULL_TREE, tmp; tree package_name = NULL_TREE, tmp;
tree this_class; tree this_class;
...@@ -489,9 +486,9 @@ tree ...@@ -489,9 +486,9 @@ tree
get_class_constant (JCF *jcf, int i) get_class_constant (JCF *jcf, int i)
{ {
tree type; tree type;
if (i <= 0 || i >= JPOOL_SIZE (jcf) gcc_assert (i > 0
|| (JPOOL_TAG (jcf, i) & ~CONSTANT_ResolvedFlag) != CONSTANT_Class) && i < JPOOL_SIZE (jcf)
abort (); && (JPOOL_TAG (jcf, i) & ~CONSTANT_ResolvedFlag) == CONSTANT_Class);
if (JPOOL_TAG (jcf, i) != CONSTANT_ResolvedClass) if (JPOOL_TAG (jcf, i) != CONSTANT_ResolvedClass)
{ {
...@@ -1421,12 +1418,9 @@ parse_zip_file_entries (void) ...@@ -1421,12 +1418,9 @@ parse_zip_file_entries (void)
CLASS_FROM_CURRENTLY_COMPILED_P (current_class) = 1; CLASS_FROM_CURRENTLY_COMPILED_P (current_class) = 1;
if (TYPE_DUMMY (class)) /* This is a dummy class, and now we're compiling it for
{ real. */
/* This is a dummy class, and now we're compiling it gcc_assert (! TYPE_DUMMY (class));
for real. */
abort ();
}
/* This is for a corner case where we have a superclass /* This is for a corner case where we have a superclass
but no superclass fields. but no superclass fields.
...@@ -1501,7 +1495,7 @@ parse_zip_file_entries (void) ...@@ -1501,7 +1495,7 @@ parse_zip_file_entries (void)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
} }
......
...@@ -80,7 +80,7 @@ const char *jcf_write_base_directory = NULL; ...@@ -80,7 +80,7 @@ const char *jcf_write_base_directory = NULL;
/* Macro to call each time we pop I words from the JVM stack. */ /* Macro to call each time we pop I words from the JVM stack. */
#define NOTE_POP(I) \ #define NOTE_POP(I) \
do { state->code_SP -= (I); if (state->code_SP < 0) abort(); } while (0) do { state->code_SP -= (I); gcc_assert (state->code_SP >= 0); } while (0)
/* A chunk or segment of a .class file. */ /* A chunk or segment of a .class file. */
...@@ -356,10 +356,8 @@ static int CHECK_PUT (void *, struct jcf_partial *, int); ...@@ -356,10 +356,8 @@ static int CHECK_PUT (void *, struct jcf_partial *, int);
static int static int
CHECK_PUT (void *ptr, struct jcf_partial *state, int i) CHECK_PUT (void *ptr, struct jcf_partial *state, int i)
{ {
if ((unsigned char *) ptr < state->chunk->data gcc_assert ((unsigned char *) ptr >= state->chunk->data
|| (unsigned char *) ptr + i > state->chunk->data + state->chunk->size) && (unsigned char *) ptr + i <= state->chunk->data + state->chunk->size);
abort ();
return 0; return 0;
} }
#else #else
...@@ -406,9 +404,7 @@ static int CHECK_OP (struct jcf_partial *); ...@@ -406,9 +404,7 @@ static int CHECK_OP (struct jcf_partial *);
static int static int
CHECK_OP (struct jcf_partial *state) CHECK_OP (struct jcf_partial *state)
{ {
if (state->bytecode.ptr > state->bytecode.limit) gcc_assert (state->bytecode.ptr <= state->bytecode.limit);
abort ();
return 0; return 0;
} }
#else #else
...@@ -609,15 +605,13 @@ maybe_free_localvar (tree decl, struct jcf_partial *state, int really) ...@@ -609,15 +605,13 @@ maybe_free_localvar (tree decl, struct jcf_partial *state, int really)
info->end_label = end_label; info->end_label = end_label;
if (info->decl != decl) gcc_assert (info->decl == decl);
abort ();
if (! really) if (! really)
return; return;
ptr[0] = NULL; ptr[0] = NULL;
if (wide) if (wide)
{ {
if (ptr[1] != (struct localvar_info *)(~0)) gcc_assert (ptr[1] == (struct localvar_info *) (~0));
abort ();
ptr[1] = NULL; ptr[1] = NULL;
} }
} }
...@@ -667,7 +661,7 @@ get_access_flags (tree decl) ...@@ -667,7 +661,7 @@ get_access_flags (tree decl)
flags |= ACC_STRICT; flags |= ACC_STRICT;
} }
else else
abort (); gcc_unreachable ();
if (TREE_CODE (decl) == FUNCTION_DECL) if (TREE_CODE (decl) == FUNCTION_DECL)
{ {
...@@ -827,7 +821,7 @@ find_constant_index (tree value, struct jcf_partial *state) ...@@ -827,7 +821,7 @@ find_constant_index (tree value, struct jcf_partial *state)
return find_string_constant (&state->cpool, value); return find_string_constant (&state->cpool, value);
else else
abort (); gcc_unreachable ();
} }
/* Push 64-bit long constant on VM stack. /* Push 64-bit long constant on VM stack.
...@@ -902,7 +896,7 @@ adjust_typed_op (tree type, int max) ...@@ -902,7 +896,7 @@ adjust_typed_op (tree type, int max)
default: default:
break; break;
} }
abort (); gcc_unreachable ();
} }
static void static void
...@@ -942,7 +936,7 @@ emit_dup (int size, int offset, struct jcf_partial *state) ...@@ -942,7 +936,7 @@ emit_dup (int size, int offset, struct jcf_partial *state)
else if (offset == 2) else if (offset == 2)
kind = size == 1 ? OPCODE_dup_x2 : OPCODE_dup2_x2; kind = size == 1 ? OPCODE_dup_x2 : OPCODE_dup2_x2;
else else
abort(); gcc_unreachable ();
OP1 (kind); OP1 (kind);
NOTE_PUSH (size); NOTE_PUSH (size);
} }
...@@ -1134,8 +1128,7 @@ generate_bytecode_conditional (tree exp, ...@@ -1134,8 +1128,7 @@ generate_bytecode_conditional (tree exp,
generate_bytecode_conditional (TREE_OPERAND (exp, 2), generate_bytecode_conditional (TREE_OPERAND (exp, 2),
true_label, false_label, true_label, false_label,
true_branch_first, state); true_branch_first, state);
if (state->code_SP != save_SP_after) gcc_assert (state->code_SP == save_SP_after);
abort ();
} }
break; break;
case TRUTH_NOT_EXPR: case TRUTH_NOT_EXPR:
...@@ -1243,7 +1236,8 @@ generate_bytecode_conditional (tree exp, ...@@ -1243,7 +1236,8 @@ generate_bytecode_conditional (tree exp,
{ {
case EQ_EXPR: op = OPCODE_if_acmpeq; break; case EQ_EXPR: op = OPCODE_if_acmpeq; break;
case NE_EXPR: op = OPCODE_if_acmpne; break; case NE_EXPR: op = OPCODE_if_acmpne; break;
default: abort(); default:
gcc_unreachable ();
} }
if (integer_zerop (exp1) || integer_zerop (exp0)) if (integer_zerop (exp1) || integer_zerop (exp0))
{ {
...@@ -1333,8 +1327,7 @@ generate_bytecode_conditional (tree exp, ...@@ -1333,8 +1327,7 @@ generate_bytecode_conditional (tree exp,
} }
break; break;
} }
if (save_SP != state->code_SP) gcc_assert (save_SP == state->code_SP);
abort ();
} }
/* Call pending cleanups i.e. those for surrounding TRY_FINALLY_EXPRs. /* Call pending cleanups i.e. those for surrounding TRY_FINALLY_EXPRs.
...@@ -1496,8 +1489,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) ...@@ -1496,8 +1489,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
if (target == IGNORE_TARGET) ; /* do nothing */ if (target == IGNORE_TARGET) ; /* do nothing */
else if (TREE_CODE (type) == POINTER_TYPE) else if (TREE_CODE (type) == POINTER_TYPE)
{ {
if (! integer_zerop (exp)) gcc_assert (integer_zerop (exp));
abort();
RESERVE(1); RESERVE(1);
OP1 (OPCODE_aconst_null); OP1 (OPCODE_aconst_null);
NOTE_PUSH (1); NOTE_PUSH (1);
...@@ -1834,7 +1826,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) ...@@ -1834,7 +1826,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
if (exp == NULL_TREE) if (exp == NULL_TREE)
exp = build_java_empty_stmt (); exp = build_java_empty_stmt ();
else if (TREE_CODE (exp) != MODIFY_EXPR) else if (TREE_CODE (exp) != MODIFY_EXPR)
abort (); gcc_unreachable ();
else else
exp = TREE_OPERAND (exp, 1); exp = TREE_OPERAND (exp, 1);
generate_bytecode_return (exp, state); generate_bytecode_return (exp, state);
...@@ -1848,8 +1840,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) ...@@ -1848,8 +1840,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
end_label->u.labeled_block = exp; end_label->u.labeled_block = exp;
if (LABELED_BLOCK_BODY (exp)) if (LABELED_BLOCK_BODY (exp))
generate_bytecode_insns (LABELED_BLOCK_BODY (exp), target, state); generate_bytecode_insns (LABELED_BLOCK_BODY (exp), target, state);
if (state->labeled_blocks != end_label) gcc_assert (state->labeled_blocks == end_label);
abort();
state->labeled_blocks = end_label->next; state->labeled_blocks = end_label->next;
define_jcf_label (end_label, state); define_jcf_label (end_label, state);
} }
...@@ -1957,7 +1948,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) ...@@ -1957,7 +1948,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
offset = 0; offset = 0;
} }
else else
abort (); gcc_unreachable ();
if (target != IGNORE_TARGET && post_op) if (target != IGNORE_TARGET && post_op)
emit_dup (size, offset, state); emit_dup (size, offset, state);
...@@ -2081,7 +2072,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) ...@@ -2081,7 +2072,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
NOTE_PUSH (TYPE_IS_WIDE (TREE_TYPE (lhs)) ? 2 : 1); NOTE_PUSH (TYPE_IS_WIDE (TREE_TYPE (lhs)) ? 2 : 1);
} }
else else
abort (); gcc_unreachable ();
/* This function correctly handles the case where the LHS /* This function correctly handles the case where the LHS
of a binary expression is NULL_TREE. */ of a binary expression is NULL_TREE. */
...@@ -2127,7 +2118,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) ...@@ -2127,7 +2118,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
NOTE_POP (TYPE_IS_WIDE (TREE_TYPE (exp)) ? 4 : 3); NOTE_POP (TYPE_IS_WIDE (TREE_TYPE (exp)) ? 4 : 3);
} }
else else
abort (); gcc_unreachable ();
break; break;
case PLUS_EXPR: case PLUS_EXPR:
jopcode = OPCODE_iadd; jopcode = OPCODE_iadd;
...@@ -2313,8 +2304,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) ...@@ -2313,8 +2304,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
struct jcf_block *end_label; /* End of try clause. */ struct jcf_block *end_label; /* End of try clause. */
struct jcf_block *finished_label = gen_jcf_label (state); struct jcf_block *finished_label = gen_jcf_label (state);
tree clause = TREE_OPERAND (exp, 1); tree clause = TREE_OPERAND (exp, 1);
if (target != IGNORE_TARGET) gcc_assert (target == IGNORE_TARGET);
abort ();
generate_bytecode_insns (try_clause, IGNORE_TARGET, state); generate_bytecode_insns (try_clause, IGNORE_TARGET, state);
end_label = get_jcf_label_here (state); end_label = get_jcf_label_here (state);
if (end_label == start_label) if (end_label == start_label)
...@@ -2369,8 +2359,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) ...@@ -2369,8 +2359,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
if (CAN_COMPLETE_NORMALLY (finally)) if (CAN_COMPLETE_NORMALLY (finally))
{ {
if (state->labeled_blocks != finally_label) gcc_assert (state->labeled_blocks == finally_label);
abort();
state->labeled_blocks = finally_label->next; state->labeled_blocks = finally_label->next;
} }
end_label = get_jcf_label_here (state); end_label = get_jcf_label_here (state);
...@@ -2517,8 +2506,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) ...@@ -2517,8 +2506,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
tree op0 = TREE_OPERAND (exp, 0); tree op0 = TREE_OPERAND (exp, 0);
tree op1 = TREE_OPERAND (exp, 1); tree op1 = TREE_OPERAND (exp, 1);
tree x; tree x;
if (TREE_SIDE_EFFECTS (op0) || TREE_SIDE_EFFECTS (op1)) gcc_assert (! TREE_SIDE_EFFECTS (op0) && ! TREE_SIDE_EFFECTS (op1));
abort ();
x = build3 (COND_EXPR, TREE_TYPE (exp), x = build3 (COND_EXPR, TREE_TYPE (exp),
build2 (code, boolean_type_node, op0, op1), build2 (code, boolean_type_node, op0, op1),
op0, op1); op0, op1);
...@@ -2645,9 +2633,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) ...@@ -2645,9 +2633,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
OP2 (index); OP2 (index);
if (interface) if (interface)
{ {
if (nargs <= 0) gcc_assert (nargs > 0);
abort ();
OP1 (nargs); OP1 (nargs);
OP1 (0); OP1 (0);
} }
...@@ -2863,8 +2849,7 @@ perform_relocations (struct jcf_partial *state) ...@@ -2863,8 +2849,7 @@ perform_relocations (struct jcf_partial *state)
*--new_ptr = - reloc->kind; *--new_ptr = - reloc->kind;
} }
} }
if (new_ptr != chunk->data) gcc_assert (new_ptr == chunk->data);
abort ();
} }
state->code_length = pc; state->code_length = pc;
} }
...@@ -3125,8 +3110,7 @@ generate_classfile (tree clas, struct jcf_partial *state) ...@@ -3125,8 +3110,7 @@ generate_classfile (tree clas, struct jcf_partial *state)
generate_bytecode_insns (body, IGNORE_TARGET, state); generate_bytecode_insns (body, IGNORE_TARGET, state);
if (CAN_COMPLETE_NORMALLY (body)) if (CAN_COMPLETE_NORMALLY (body))
{ {
if (TREE_CODE (TREE_TYPE (type)) != VOID_TYPE) gcc_assert (TREE_CODE (TREE_TYPE (type)) == VOID_TYPE);
abort();
RESERVE (1); RESERVE (1);
OP1 (OPCODE_return); OP1 (OPCODE_return);
} }
......
...@@ -335,7 +335,7 @@ java_handle_option (size_t scode, const char *arg, int value) ...@@ -335,7 +335,7 @@ java_handle_option (size_t scode, const char *arg, int value)
default: default:
if (cl_options[code].flags & CL_Java) if (cl_options[code].flags & CL_Java)
break; break;
abort(); gcc_unreachable ();
} }
return 1; return 1;
...@@ -781,8 +781,7 @@ merge_init_test_initialization (void **entry, void *x) ...@@ -781,8 +781,7 @@ merge_init_test_initialization (void **entry, void *x)
/* See if we have remapped this declaration. If we haven't there's /* See if we have remapped this declaration. If we haven't there's
a bug in the inliner. */ a bug in the inliner. */
n = splay_tree_lookup (decl_map, (splay_tree_key) ite->value); n = splay_tree_lookup (decl_map, (splay_tree_key) ite->value);
if (! n) gcc_assert (n);
abort ();
/* Create a new entry for the class and its remapped boolean /* Create a new entry for the class and its remapped boolean
variable. If we already have a mapping for this class we've variable. If we already have a mapping for this class we've
......
...@@ -280,7 +280,7 @@ mangle_type (tree type) ...@@ -280,7 +280,7 @@ mangle_type (tree type)
break; break;
bad_type: bad_type:
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -397,8 +397,7 @@ mangle_record_type (tree type, int for_pointer) ...@@ -397,8 +397,7 @@ mangle_record_type (tree type, int for_pointer)
#define ADD_N() \ #define ADD_N() \
do { obstack_1grow (mangle_obstack, 'N'); nadded_p = 1; } while (0) do { obstack_1grow (mangle_obstack, 'N'); nadded_p = 1; } while (0)
if (TREE_CODE (type) != RECORD_TYPE) gcc_assert (TREE_CODE (type) == RECORD_TYPE);
abort ();
if (!TYPE_PACKAGE_LIST (type)) if (!TYPE_PACKAGE_LIST (type))
set_type_package_list (type); set_type_package_list (type);
...@@ -450,8 +449,7 @@ mangle_pointer_type (tree type) ...@@ -450,8 +449,7 @@ mangle_pointer_type (tree type)
/* This didn't work. We start by mangling the pointed-to type */ /* This didn't work. We start by mangling the pointed-to type */
pointer_type = type; pointer_type = type;
type = TREE_TYPE (type); type = TREE_TYPE (type);
if (TREE_CODE (type) != RECORD_TYPE) gcc_assert (TREE_CODE (type) == RECORD_TYPE);
abort ();
obstack_1grow (mangle_obstack, 'P'); obstack_1grow (mangle_obstack, 'P');
if (mangle_record_type (type, /* for_pointer = */ 1)) if (mangle_record_type (type, /* for_pointer = */ 1))
...@@ -473,8 +471,7 @@ mangle_array_type (tree p_type) ...@@ -473,8 +471,7 @@ mangle_array_type (tree p_type)
int match; int match;
type = TREE_TYPE (p_type); type = TREE_TYPE (p_type);
if (!type) gcc_assert (type);
abort ();
elt_type = TYPE_ARRAY_ELEMENT (type); elt_type = TYPE_ARRAY_ELEMENT (type);
......
...@@ -55,8 +55,7 @@ set_local_type (int slot, tree type) ...@@ -55,8 +55,7 @@ set_local_type (int slot, tree type)
int max_locals = DECL_MAX_LOCALS(current_function_decl); int max_locals = DECL_MAX_LOCALS(current_function_decl);
int nslots = TYPE_IS_WIDE (type) ? 2 : 1; int nslots = TYPE_IS_WIDE (type) ? 2 : 1;
if (slot < 0 || slot + nslots - 1 >= max_locals) gcc_assert (slot >= 0 && (slot + nslots - 1 < max_locals));
abort ();
type_map[slot] = type; type_map[slot] = type;
while (--nslots > 0) while (--nslots > 0)
...@@ -458,9 +457,7 @@ static tree ...@@ -458,9 +457,7 @@ static tree
parse_signature_type (const unsigned char **ptr, const unsigned char *limit) parse_signature_type (const unsigned char **ptr, const unsigned char *limit)
{ {
tree type; tree type;
gcc_assert (*ptr < limit);
if (*ptr >= limit)
abort ();
switch (**ptr) switch (**ptr)
{ {
...@@ -484,8 +481,7 @@ parse_signature_type (const unsigned char **ptr, const unsigned char *limit) ...@@ -484,8 +481,7 @@ parse_signature_type (const unsigned char **ptr, const unsigned char *limit)
const unsigned char *str = start; const unsigned char *str = start;
for ( ; ; str++) for ( ; ; str++)
{ {
if (str >= limit) gcc_assert (str < limit);
abort ();
if (*str == ';') if (*str == ';')
break; break;
} }
...@@ -494,7 +490,7 @@ parse_signature_type (const unsigned char **ptr, const unsigned char *limit) ...@@ -494,7 +490,7 @@ parse_signature_type (const unsigned char **ptr, const unsigned char *limit)
break; break;
} }
default: default:
abort (); gcc_unreachable ();
} }
return promote_type (type); return promote_type (type);
} }
...@@ -662,7 +658,7 @@ build_java_signature (tree type) ...@@ -662,7 +658,7 @@ build_java_signature (tree type)
break; break;
bad_type: bad_type:
default: default:
abort (); gcc_unreachable ();
} }
TYPE_SIGNATURE (type) = sig; TYPE_SIGNATURE (type) = sig;
} }
......
...@@ -252,8 +252,7 @@ char ...@@ -252,8 +252,7 @@ char
vfy_get_primitive_char (vfy_jclass klass) vfy_get_primitive_char (vfy_jclass klass)
{ {
tree sig; tree sig;
if (! vfy_is_primitive (klass)) gcc_assert (vfy_is_primitive (klass));
abort ();
sig = build_java_signature (klass); sig = build_java_signature (klass);
return (IDENTIFIER_POINTER (sig))[0]; return (IDENTIFIER_POINTER (sig))[0];
} }
...@@ -296,8 +295,7 @@ vfy_jclass ...@@ -296,8 +295,7 @@ vfy_jclass
vfy_get_component_type (vfy_jclass klass) vfy_get_component_type (vfy_jclass klass)
{ {
vfy_jclass k; vfy_jclass k;
if (! vfy_is_array (klass)) gcc_assert (vfy_is_array (klass));
abort ();
k = TYPE_ARRAY_ELEMENT (klass); k = TYPE_ARRAY_ELEMENT (klass);
if (TREE_CODE (k) == POINTER_TYPE) if (TREE_CODE (k) == POINTER_TYPE)
k = TREE_TYPE (k); k = TREE_TYPE (k);
......
...@@ -3178,7 +3178,7 @@ collapse_type (type *t) ...@@ -3178,7 +3178,7 @@ collapse_type (type *t)
return vfy_object_type (); return vfy_object_type ();
} }
abort (); gcc_unreachable ();
} }
static void static void
...@@ -3220,8 +3220,7 @@ verify_instructions (void) ...@@ -3220,8 +3220,7 @@ verify_instructions (void)
vfy_unsuitable_type ()); vfy_unsuitable_type ());
} }
} }
if (slot != curr->stackdepth) gcc_assert (slot == curr->stackdepth);
abort ();
} }
} }
......
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