Commit 366de0ce by Nathan Sidwell Committed by Nathan Sidwell

c-aux-info.c (gen_type): Use gcc_assert or gcc_unreachable.

	* c-aux-info.c (gen_type): Use gcc_assert or gcc_unreachable.
	* c-common.c (c_type_hash, c_common_nodes_and_builtins,
	c_expand_expr, boolean_increment, nonnull_check_p,
	check_function_arguments_recurse, fold_offsetof_1): Likewise.
	* c-cppbuiltin.c (define__GNUC__, builtin_define_stdint_macros,
	builtin_define_type_max): Likewise.
	* c-decl.c (bind, pop_scope, merge_decls, pushdecl_top_level,
	implicit_decl_warning, builtin_function, build_compound_literal,
	complete_array_type, grokdeclarator, get_parm_info,
	start_function, store_parm_decls_oldstyle,
	c_write_global_declarations): Likewise.
	* c-format.c (get_constant, decode_format_attr,
	maybe_read_dollar_number, get_flag_spec, check_format_arg,
	check_format_types, format_type_warning,
	find_char_info_specifier_index, init_dynamic_asm_fprintf_info,
	init_dynamic_diag_info, handle_format_attribute): Likewise.
	* c-gimplify.c (push_context, pop_context, finish_bc_block):
	* c-lex.c (c_lex_with_flags, lex_string): Likewise.
	* c-objc-common.c (c_tree_printer): Likewise.
	* c-pch.c (pch_init): Likewise.
	* c-pragma.c (maybe_apply_pragma_weak): Likewise.
	* c-pretty-print.c (pp_c_tree_decl_identifier): Likewise.
	* c-typeck.c (c_incomplete_type_error, composite_type,
	common_pointer_type, common_type, same_translation_unit_p,
	tagged_types_tu_compatible_p, finish_init, pop_init_level,
	set_designator, set_nonincremental_init_from_string,
	process_init_element, c_finish_if_stmt): Likewise.
	* caller-save.c (init_caller_save, save_call_clobbered_regs,
	insert_restore, insert_save, insert_one_insn): Likewise.
	* calls.c (emit_call_1, compute_argument_block_size,
	precompute_arguments, expand_call, emit_library_call_value_1,
	store_one_arg): Likewise.

From-SVN: r87140
parent e1bbfc5c
2004-09-07 Nathan Sidwell <nathan@codesourcery.com> 2004-09-07 Nathan Sidwell <nathan@codesourcery.com>
* c-aux-info.c (gen_type): Use gcc_assert or gcc_unreachable.
* c-common.c (c_type_hash, c_common_nodes_and_builtins,
c_expand_expr, boolean_increment, nonnull_check_p,
check_function_arguments_recurse, fold_offsetof_1): Likewise.
* c-cppbuiltin.c (define__GNUC__, builtin_define_stdint_macros,
builtin_define_type_max): Likewise.
* c-decl.c (bind, pop_scope, merge_decls, pushdecl_top_level,
implicit_decl_warning, builtin_function, build_compound_literal,
complete_array_type, grokdeclarator, get_parm_info,
start_function, store_parm_decls_oldstyle,
c_write_global_declarations): Likewise.
* c-format.c (get_constant, decode_format_attr,
maybe_read_dollar_number, get_flag_spec, check_format_arg,
check_format_types, format_type_warning,
find_char_info_specifier_index, init_dynamic_asm_fprintf_info,
init_dynamic_diag_info, handle_format_attribute): Likewise.
* c-gimplify.c (push_context, pop_context, finish_bc_block):
* c-lex.c (c_lex_with_flags, lex_string): Likewise.
* c-objc-common.c (c_tree_printer): Likewise.
* c-pch.c (pch_init): Likewise.
* c-pragma.c (maybe_apply_pragma_weak): Likewise.
* c-pretty-print.c (pp_c_tree_decl_identifier): Likewise.
* c-typeck.c (c_incomplete_type_error, composite_type,
common_pointer_type, common_type, same_translation_unit_p,
tagged_types_tu_compatible_p, finish_init, pop_init_level,
set_designator, set_nonincremental_init_from_string,
process_init_element, c_finish_if_stmt): Likewise.
* caller-save.c (init_caller_save, save_call_clobbered_regs,
insert_restore, insert_save, insert_one_insn): Likewise.
* calls.c (emit_call_1, compute_argument_block_size,
precompute_arguments, expand_call, emit_library_call_value_1,
store_one_arg): Likewise.
2004-09-07 Nathan Sidwell <nathan@codesourcery.com>
* configure.ac (enable-checking): Add release option. Reorganize * configure.ac (enable-checking): Add release option. Reorganize
to avoid repetition. to avoid repetition.
* configure: Rebuilt. * configure: Rebuilt.
......
...@@ -447,7 +447,7 @@ gen_type (const char *ret_val, tree t, formals_style style) ...@@ -447,7 +447,7 @@ gen_type (const char *ret_val, tree t, formals_style style)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
if (TYPE_READONLY (t)) if (TYPE_READONLY (t))
......
...@@ -2578,7 +2578,7 @@ c_type_hash (const void *p) ...@@ -2578,7 +2578,7 @@ c_type_hash (const void *p)
t2 = TYPE_FIELDS (t); t2 = TYPE_FIELDS (t);
break; break;
default: default:
abort (); gcc_unreachable ();
} }
for (; t2; t2 = TREE_CHAIN (t2)) for (; t2; t2 = TREE_CHAIN (t2))
i++; i++;
...@@ -3188,8 +3188,8 @@ c_common_nodes_and_builtins (void) ...@@ -3188,8 +3188,8 @@ c_common_nodes_and_builtins (void)
{ \ { \
tree decl; \ tree decl; \
\ \
if (strncmp (NAME, "__builtin_", strlen ("__builtin_")) != 0) \ gcc_assert (!strncmp (NAME, "__builtin_", \
abort (); \ strlen ("__builtin_"))); \
\ \
if (!BOTH_P) \ if (!BOTH_P) \
decl = lang_hooks.builtin_function (NAME, builtin_types[TYPE], \ decl = lang_hooks.builtin_function (NAME, builtin_types[TYPE], \
...@@ -3830,7 +3830,7 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode, ...@@ -3830,7 +3830,7 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode,
} }
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -3878,7 +3878,7 @@ boolean_increment (enum tree_code code, tree arg) ...@@ -3878,7 +3878,7 @@ boolean_increment (enum tree_code code, tree arg)
val = build2 (COMPOUND_EXPR, TREE_TYPE (arg), arg, val); val = build2 (COMPOUND_EXPR, TREE_TYPE (arg), arg, val);
break; break;
default: default:
abort (); gcc_unreachable ();
} }
TREE_SIDE_EFFECTS (val) = 1; TREE_SIDE_EFFECTS (val) = 1;
return val; return val;
...@@ -5111,8 +5111,9 @@ nonnull_check_p (tree args, unsigned HOST_WIDE_INT param_num) ...@@ -5111,8 +5111,9 @@ nonnull_check_p (tree args, unsigned HOST_WIDE_INT param_num)
for (; args; args = TREE_CHAIN (args)) for (; args; args = TREE_CHAIN (args))
{ {
if (! get_nonnull_operand (TREE_VALUE (args), &arg_num)) bool found = get_nonnull_operand (TREE_VALUE (args), &arg_num);
abort ();
gcc_assert (found);
if (arg_num == param_num) if (arg_num == param_num)
return true; return true;
...@@ -5356,9 +5357,8 @@ check_function_arguments_recurse (void (*callback) ...@@ -5356,9 +5357,8 @@ check_function_arguments_recurse (void (*callback)
|| TREE_CODE (format_num_expr) == NON_LVALUE_EXPR) || TREE_CODE (format_num_expr) == NON_LVALUE_EXPR)
format_num_expr = TREE_OPERAND (format_num_expr, 0); format_num_expr = TREE_OPERAND (format_num_expr, 0);
if (TREE_CODE (format_num_expr) != INTEGER_CST gcc_assert (TREE_CODE (format_num_expr) == INTEGER_CST
|| TREE_INT_CST_HIGH (format_num_expr) != 0) && !TREE_INT_CST_HIGH (format_num_expr));
abort ();
format_num = TREE_INT_CST_LOW (format_num_expr); format_num = TREE_INT_CST_LOW (format_num_expr);
...@@ -5619,7 +5619,7 @@ fold_offsetof_1 (tree expr) ...@@ -5619,7 +5619,7 @@ fold_offsetof_1 (tree expr)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
return size_binop (code, base, off); return size_binop (code, base, off);
......
...@@ -261,8 +261,7 @@ define__GNUC__ (void) ...@@ -261,8 +261,7 @@ define__GNUC__ (void)
while (*v && ! ISDIGIT (*v)) while (*v && ! ISDIGIT (*v))
v++; v++;
if (!*v || (v > version_string && v[-1] != '-')) gcc_assert (*v && (v <= version_string || v[-1] == '-'));
abort ();
q = v; q = v;
while (ISDIGIT (*v)) while (ISDIGIT (*v))
...@@ -271,8 +270,8 @@ define__GNUC__ (void) ...@@ -271,8 +270,8 @@ define__GNUC__ (void)
if (c_dialect_cxx ()) if (c_dialect_cxx ())
builtin_define_with_value_n ("__GNUG__", q, v - q); builtin_define_with_value_n ("__GNUG__", q, v - q);
if (*v != '.' || !ISDIGIT (v[1])) gcc_assert (*v == '.' || ISDIGIT (v[1]));
abort ();
q = ++v; q = ++v;
while (ISDIGIT (*v)) while (ISDIGIT (*v))
v++; v++;
...@@ -280,8 +279,7 @@ define__GNUC__ (void) ...@@ -280,8 +279,7 @@ define__GNUC__ (void)
if (*v == '.') if (*v == '.')
{ {
if (!ISDIGIT (v[1])) gcc_assert (ISDIGIT (v[1]));
abort ();
q = ++v; q = ++v;
while (ISDIGIT (*v)) while (ISDIGIT (*v))
v++; v++;
...@@ -290,8 +288,7 @@ define__GNUC__ (void) ...@@ -290,8 +288,7 @@ define__GNUC__ (void)
else else
builtin_define_with_value_n ("__GNUC_PATCHLEVEL__", "0", 1); builtin_define_with_value_n ("__GNUC_PATCHLEVEL__", "0", 1);
if (*v && *v != ' ' && *v != '-') gcc_assert (!*v || *v == ' ' || *v == '-');
abort ();
} }
/* Define macros used by <stdint.h>. Currently only defines limits /* Define macros used by <stdint.h>. Currently only defines limits
...@@ -307,7 +304,7 @@ builtin_define_stdint_macros (void) ...@@ -307,7 +304,7 @@ builtin_define_stdint_macros (void)
else if (intmax_type_node == integer_type_node) else if (intmax_type_node == integer_type_node)
intmax_long = 0; intmax_long = 0;
else else
abort (); gcc_unreachable ();
builtin_define_type_max ("__INTMAX_MAX__", intmax_type_node, intmax_long); builtin_define_type_max ("__INTMAX_MAX__", intmax_type_node, intmax_long);
} }
...@@ -617,7 +614,7 @@ builtin_define_type_max (const char *macro, tree type, int is_long) ...@@ -617,7 +614,7 @@ builtin_define_type_max (const char *macro, tree type, int is_long)
case 32: idx = 4; break; case 32: idx = 4; break;
case 64: idx = 6; break; case 64: idx = 6; break;
case 128: idx = 8; break; case 128: idx = 8; break;
default: abort (); default: gcc_unreachable ();
} }
value = values[idx + TYPE_UNSIGNED (type)]; value = values[idx + TYPE_UNSIGNED (type)];
......
...@@ -151,7 +151,7 @@ check_format_string (tree argument, unsigned HOST_WIDE_INT format_num, ...@@ -151,7 +151,7 @@ check_format_string (tree argument, unsigned HOST_WIDE_INT format_num,
and store its value. If validated_p is true, abort on errors. and store its value. If validated_p is true, abort on errors.
Returns true on success, false otherwise. */ Returns true on success, false otherwise. */
static bool static bool
get_constant(tree expr, unsigned HOST_WIDE_INT *value, int validated_p) get_constant (tree expr, unsigned HOST_WIDE_INT *value, int validated_p)
{ {
while (TREE_CODE (expr) == NOP_EXPR while (TREE_CODE (expr) == NOP_EXPR
|| TREE_CODE (expr) == CONVERT_EXPR || TREE_CODE (expr) == CONVERT_EXPR
...@@ -160,8 +160,7 @@ get_constant(tree expr, unsigned HOST_WIDE_INT *value, int validated_p) ...@@ -160,8 +160,7 @@ get_constant(tree expr, unsigned HOST_WIDE_INT *value, int validated_p)
if (TREE_CODE (expr) != INTEGER_CST || TREE_INT_CST_HIGH (expr) != 0) if (TREE_CODE (expr) != INTEGER_CST || TREE_INT_CST_HIGH (expr) != 0)
{ {
if (validated_p) gcc_assert (!validated_p);
abort ();
return false; return false;
} }
...@@ -187,8 +186,7 @@ decode_format_attr (tree args, function_format_info *info, int validated_p) ...@@ -187,8 +186,7 @@ decode_format_attr (tree args, function_format_info *info, int validated_p)
if (TREE_CODE (format_type_id) != IDENTIFIER_NODE) if (TREE_CODE (format_type_id) != IDENTIFIER_NODE)
{ {
if (validated_p) gcc_assert (!validated_p);
abort ();
error ("unrecognized format specifier"); error ("unrecognized format specifier");
return false; return false;
} }
...@@ -200,8 +198,7 @@ decode_format_attr (tree args, function_format_info *info, int validated_p) ...@@ -200,8 +198,7 @@ decode_format_attr (tree args, function_format_info *info, int validated_p)
if (info->format_type == format_type_error) if (info->format_type == format_type_error)
{ {
if (validated_p) gcc_assert (!validated_p);
abort ();
warning ("%qs is an unrecognized format function type", p); warning ("%qs is an unrecognized format function type", p);
return false; return false;
} }
...@@ -221,8 +218,7 @@ decode_format_attr (tree args, function_format_info *info, int validated_p) ...@@ -221,8 +218,7 @@ decode_format_attr (tree args, function_format_info *info, int validated_p)
if (info->first_arg_num != 0 && info->first_arg_num <= info->format_num) if (info->first_arg_num != 0 && info->first_arg_num <= info->format_num)
{ {
if (validated_p) gcc_assert (!validated_p);
abort ();
error ("format string arg follows the args to be formatted"); error ("format string arg follows the args to be formatted");
return false; return false;
} }
...@@ -1004,11 +1000,8 @@ maybe_read_dollar_number (const char **format, ...@@ -1004,11 +1000,8 @@ maybe_read_dollar_number (const char **format,
for (i = 1; i < argnum && *param_ptr != 0; i++) for (i = 1; i < argnum && *param_ptr != 0; i++)
*param_ptr = TREE_CHAIN (*param_ptr); *param_ptr = TREE_CHAIN (*param_ptr);
if (*param_ptr == 0) /* This case shouldn't be caught here. */
{ gcc_assert (*param_ptr);
/* This case shouldn't be caught here. */
abort ();
}
} }
else else
*param_ptr = 0; *param_ptr = 0;
...@@ -1096,10 +1089,8 @@ get_flag_spec (const format_flag_spec *spec, int flag, const char *predicates) ...@@ -1096,10 +1089,8 @@ get_flag_spec (const format_flag_spec *spec, int flag, const char *predicates)
else if (spec[i].predicate == 0) else if (spec[i].predicate == 0)
return &spec[i]; return &spec[i];
} }
if (predicates == NULL) gcc_assert (predicates);
abort (); return NULL;
else
return NULL;
} }
...@@ -1299,8 +1290,8 @@ check_format_arg (void *ctx, tree format_tree, ...@@ -1299,8 +1290,8 @@ check_format_arg (void *ctx, tree format_tree,
if (array_size != 0) if (array_size != 0)
{ {
/* Variable length arrays can't be initialized. */ /* Variable length arrays can't be initialized. */
if (TREE_CODE (array_size) != INTEGER_CST) gcc_assert (TREE_CODE (array_size) == INTEGER_CST);
abort ();
if (host_integerp (array_size, 0)) if (host_integerp (array_size, 0))
{ {
HOST_WIDE_INT array_size_value = TREE_INT_CST_LOW (array_size); HOST_WIDE_INT array_size_value = TREE_INT_CST_LOW (array_size);
...@@ -2053,10 +2044,8 @@ check_format_types (format_wanted_type *types, const char *format_start, ...@@ -2053,10 +2044,8 @@ check_format_types (format_wanted_type *types, const char *format_start,
arg_num = types->arg_num; arg_num = types->arg_num;
/* The following should not occur here. */ /* The following should not occur here. */
if (wanted_type == 0) gcc_assert (wanted_type);
abort (); gcc_assert (wanted_type != void_type_node || types->pointer_count);
if (wanted_type == void_type_node && types->pointer_count == 0)
abort ();
if (types->pointer_count == 0) if (types->pointer_count == 0)
wanted_type = lang_hooks.types.type_promotes_to (wanted_type); wanted_type = lang_hooks.types.type_promotes_to (wanted_type);
...@@ -2253,17 +2242,14 @@ format_type_warning (const char *descr, const char *format_start, ...@@ -2253,17 +2242,14 @@ format_type_warning (const char *descr, const char *format_start,
static unsigned int static unsigned int
find_char_info_specifier_index (const format_char_info *fci, int c) find_char_info_specifier_index (const format_char_info *fci, int c)
{ {
unsigned int i = 0; unsigned i;
while (fci->format_chars) for (i = 0; fci->format_chars; i++, fci++)
{ if (strchr (fci->format_chars, c))
if (strchr (fci->format_chars, c)) return i;
return i;
i++; fci++;
}
/* We shouldn't be looking for a non-existent specifier. */ /* We shouldn't be looking for a non-existent specifier. */
abort (); gcc_unreachable ();
} }
/* Given a format_length_info array FLI, and a character C, this /* Given a format_length_info array FLI, and a character C, this
...@@ -2273,17 +2259,14 @@ find_char_info_specifier_index (const format_char_info *fci, int c) ...@@ -2273,17 +2259,14 @@ find_char_info_specifier_index (const format_char_info *fci, int c)
static unsigned int static unsigned int
find_length_info_modifier_index (const format_length_info *fli, int c) find_length_info_modifier_index (const format_length_info *fli, int c)
{ {
unsigned int i = 0; unsigned i;
while (fli->name) for (i = 0; fli->name; i++, fli++)
{ if (strchr (fli->name, c))
if (strchr (fli->name, c)) return i;
return i;
i++; fli++;
}
/* We shouldn't be looking for a non-existent modifier. */ /* We shouldn't be looking for a non-existent modifier. */
abort (); gcc_unreachable ();
} }
/* Determine the type of HOST_WIDE_INT in the code being compiled for /* Determine the type of HOST_WIDE_INT in the code being compiled for
...@@ -2293,7 +2276,7 @@ static void ...@@ -2293,7 +2276,7 @@ static void
init_dynamic_asm_fprintf_info (void) init_dynamic_asm_fprintf_info (void)
{ {
static tree hwi; static tree hwi;
if (!hwi) if (!hwi)
{ {
format_length_info *new_asm_fprintf_length_specs; format_length_info *new_asm_fprintf_length_specs;
...@@ -2303,9 +2286,10 @@ init_dynamic_asm_fprintf_info (void) ...@@ -2303,9 +2286,10 @@ init_dynamic_asm_fprintf_info (void)
length modifier to work, one must have issued: "typedef length modifier to work, one must have issued: "typedef
HOST_WIDE_INT __gcc_host_wide_int__;" in one's source code HOST_WIDE_INT __gcc_host_wide_int__;" in one's source code
prior to using that modifier. */ prior to using that modifier. */
if (!(hwi = maybe_get_identifier ("__gcc_host_wide_int__")) hwi = maybe_get_identifier ("__gcc_host_wide_int__");
|| !(hwi = DECL_ORIGINAL_TYPE (identifier_global_value (hwi)))) gcc_assert (hwi);
abort (); hwi = DECL_ORIGINAL_TYPE (identifier_global_value (hwi));
gcc_assert (hwi);
/* Create a new (writable) copy of asm_fprintf_length_specs. */ /* Create a new (writable) copy of asm_fprintf_length_specs. */
new_asm_fprintf_length_specs = (format_length_info *) new_asm_fprintf_length_specs = (format_length_info *)
...@@ -2320,7 +2304,7 @@ init_dynamic_asm_fprintf_info (void) ...@@ -2320,7 +2304,7 @@ init_dynamic_asm_fprintf_info (void)
else if (hwi == long_long_integer_type_node) else if (hwi == long_long_integer_type_node)
new_asm_fprintf_length_specs[i].index = FMT_LEN_ll; new_asm_fprintf_length_specs[i].index = FMT_LEN_ll;
else else
abort (); gcc_unreachable ();
/* Assign the new data for use. */ /* Assign the new data for use. */
dynamic_format_types[asm_fprintf_format_type].length_char_specs = dynamic_format_types[asm_fprintf_format_type].length_char_specs =
...@@ -2383,7 +2367,7 @@ init_dynamic_diag_info (void) ...@@ -2383,7 +2367,7 @@ init_dynamic_diag_info (void)
else if (hwi == long_long_integer_type_node) else if (hwi == long_long_integer_type_node)
diag_ls[i].index = FMT_LEN_ll; diag_ls[i].index = FMT_LEN_ll;
else else
abort (); gcc_unreachable ();
} }
/* Handle the __gcc_diag__ format specifics. */ /* Handle the __gcc_diag__ format specifics. */
...@@ -2551,7 +2535,7 @@ handle_format_attribute (tree *node, tree ARG_UNUSED (name), tree args, ...@@ -2551,7 +2535,7 @@ handle_format_attribute (tree *node, tree ARG_UNUSED (name), tree args,
|| info.format_type == gcc_cxxdiag_format_type) || info.format_type == gcc_cxxdiag_format_type)
init_dynamic_diag_info(); init_dynamic_diag_info();
else else
abort(); gcc_unreachable();
} }
return NULL_TREE; return NULL_TREE;
......
...@@ -84,8 +84,7 @@ static struct c_gimplify_ctx ...@@ -84,8 +84,7 @@ static struct c_gimplify_ctx
static void static void
push_context (void) push_context (void)
{ {
if (ctxp) gcc_assert (!ctxp);
abort ();
ctxp = (struct c_gimplify_ctx *) xcalloc (1, sizeof (struct c_gimplify_ctx)); ctxp = (struct c_gimplify_ctx *) xcalloc (1, sizeof (struct c_gimplify_ctx));
ctxp->bc_id[bc_continue] = get_identifier ("continue"); ctxp->bc_id[bc_continue] = get_identifier ("continue");
ctxp->bc_id[bc_break] = get_identifier ("break"); ctxp->bc_id[bc_break] = get_identifier ("break");
...@@ -94,8 +93,7 @@ push_context (void) ...@@ -94,8 +93,7 @@ push_context (void)
static void static void
pop_context (void) pop_context (void)
{ {
if (!ctxp || ctxp->current_bc_label) gcc_assert (ctxp && !ctxp->current_bc_label);
abort ();
free (ctxp); free (ctxp);
ctxp = NULL; ctxp = NULL;
} }
...@@ -275,8 +273,7 @@ begin_bc_block (enum bc_t bc) ...@@ -275,8 +273,7 @@ begin_bc_block (enum bc_t bc)
static tree static tree
finish_bc_block (tree label, tree body) finish_bc_block (tree label, tree body)
{ {
if (label != ctxp->current_bc_label) gcc_assert (label == ctxp->current_bc_label);
abort ();
if (TREE_USED (label)) if (TREE_USED (label))
{ {
......
...@@ -373,7 +373,7 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags) ...@@ -373,7 +373,7 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
break; break;
...@@ -435,7 +435,7 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags) ...@@ -435,7 +435,7 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags)
case CPP_HEADER_NAME: case CPP_HEADER_NAME:
case CPP_COMMENT: case CPP_COMMENT:
case CPP_MACRO_ARG: case CPP_MACRO_ARG:
abort (); gcc_unreachable ();
default: default:
*value = NULL_TREE; *value = NULL_TREE;
...@@ -737,12 +737,11 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string) ...@@ -737,12 +737,11 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
if (c_lex_string_translate == -1) if (c_lex_string_translate == -1)
{ {
if (!cpp_interpret_string_notranslate (parse_in, strs, count, int xlated = cpp_interpret_string_notranslate (parse_in, strs, count,
&istr, wide)) &istr, wide);
/* Assume that, if we managed to translate the string /* Assume that, if we managed to translate the string above,
above, then the untranslated parsing will always then the untranslated parsing will always succeed. */
succeed. */ gcc_assert (xlated);
abort ();
if (TREE_STRING_LENGTH (value) != (int)istr.len if (TREE_STRING_LENGTH (value) != (int)istr.len
|| 0 != strncmp (TREE_STRING_POINTER (value), (char *)istr.text, || 0 != strncmp (TREE_STRING_POINTER (value), (char *)istr.text,
......
...@@ -213,10 +213,9 @@ c_tree_printer (pretty_printer *pp, text_info *text) ...@@ -213,10 +213,9 @@ c_tree_printer (pretty_printer *pp, text_info *text)
break; break;
case 'T': case 'T':
if (TYPE_P (t)) gcc_assert (TYPE_P (t));
name = TYPE_NAME (t); name = TYPE_NAME (t);
else
abort ();
if (name && TREE_CODE (name) == TYPE_DECL) if (name && TREE_CODE (name) == TYPE_DECL)
{ {
if (DECL_NAME (name)) if (DECL_NAME (name))
......
...@@ -129,10 +129,10 @@ pch_init (void) ...@@ -129,10 +129,10 @@ pch_init (void)
if (f == NULL) if (f == NULL)
fatal_error ("can't create precompiled header %s: %m", pch_file); fatal_error ("can't create precompiled header %s: %m", pch_file);
pch_outfile = f; pch_outfile = f;
if (strlen (host_machine) > 255 || strlen (target_machine) > 255 gcc_assert (strlen (host_machine) < 256
|| strlen (version_string) > 255) && strlen (target_machine) < 256
abort (); && strlen (version_string) < 256);
v.host_machine_length = strlen (host_machine); v.host_machine_length = strlen (host_machine);
v.target_machine_length = strlen (target_machine); v.target_machine_length = strlen (target_machine);
...@@ -143,8 +143,7 @@ pch_init (void) ...@@ -143,8 +143,7 @@ pch_init (void)
for (i = 0; i < MATCH_SIZE; i++) for (i = 0; i < MATCH_SIZE; i++)
{ {
v.match[i] = *pch_matching[i].flag_var; v.match[i] = *pch_matching[i].flag_var;
if (v.match[i] != *pch_matching[i].flag_var) gcc_assert (v.match[i] == *pch_matching[i].flag_var);
abort ();
} }
} }
v.pch_init = &pch_init; v.pch_init = &pch_init;
......
...@@ -279,7 +279,7 @@ maybe_apply_pragma_weak (tree decl) ...@@ -279,7 +279,7 @@ maybe_apply_pragma_weak (tree decl)
return; return;
/* If it's not a function or a variable, it can't be weak. /* If it's not a function or a variable, it can't be weak.
FIXME: what kinds of things are visible outside this file but FIXME: what kinds of things are visible outside this file but
aren't functions or variables? Should this be an abort() instead? */ aren't functions or variables? Should this be an assert instead? */
if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL) if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
return; return;
......
...@@ -2139,8 +2139,7 @@ pp_c_tree_decl_identifier (c_pretty_printer *pp, tree t) ...@@ -2139,8 +2139,7 @@ pp_c_tree_decl_identifier (c_pretty_printer *pp, tree t)
{ {
const char *name; const char *name;
if (!DECL_P (t)) gcc_assert (DECL_P (t));
abort ();
if (DECL_NAME (t)) if (DECL_NAME (t))
name = IDENTIFIER_POINTER (DECL_NAME (t)); name = IDENTIFIER_POINTER (DECL_NAME (t));
......
...@@ -157,7 +157,7 @@ c_incomplete_type_error (tree value, tree type) ...@@ -157,7 +157,7 @@ c_incomplete_type_error (tree value, tree type)
return; return;
default: default:
abort (); gcc_unreachable ();
} }
if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE) if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
...@@ -240,8 +240,7 @@ composite_type (tree t1, tree t2) ...@@ -240,8 +240,7 @@ composite_type (tree t1, tree t2)
if (code2 == ENUMERAL_TYPE && code1 == INTEGER_TYPE) if (code2 == ENUMERAL_TYPE && code1 == INTEGER_TYPE)
return t2; return t2;
if (code1 != code2) gcc_assert (code1 == code2);
abort ();
switch (code1) switch (code1)
{ {
...@@ -261,8 +260,7 @@ composite_type (tree t1, tree t2) ...@@ -261,8 +260,7 @@ composite_type (tree t1, tree t2)
tree elt = composite_type (TREE_TYPE (t1), TREE_TYPE (t2)); tree elt = composite_type (TREE_TYPE (t1), TREE_TYPE (t2));
/* We should not have any type quals on arrays at all. */ /* We should not have any type quals on arrays at all. */
if (TYPE_QUALS (t1) || TYPE_QUALS (t2)) gcc_assert (!TYPE_QUALS (t1) && !TYPE_QUALS (t2));
abort ();
/* Save space: see if the result is identical to one of the args. */ /* Save space: see if the result is identical to one of the args. */
if (elt == TREE_TYPE (t1) && TYPE_DOMAIN (t1)) if (elt == TREE_TYPE (t1) && TYPE_DOMAIN (t1))
...@@ -412,8 +410,8 @@ common_pointer_type (tree t1, tree t2) ...@@ -412,8 +410,8 @@ common_pointer_type (tree t1, tree t2)
if (t2 == error_mark_node) if (t2 == error_mark_node)
return t1; return t1;
if (TREE_CODE (t1) != POINTER_TYPE || TREE_CODE (t2) != POINTER_TYPE) gcc_assert (TREE_CODE (t1) == POINTER_TYPE
abort (); && TREE_CODE (t2) == POINTER_TYPE);
/* Merge the attributes. */ /* Merge the attributes. */
attributes = targetm.merge_type_attributes (t1, t2); attributes = targetm.merge_type_attributes (t1, t2);
...@@ -470,13 +468,10 @@ common_type (tree t1, tree t2) ...@@ -470,13 +468,10 @@ common_type (tree t1, tree t2)
code1 = TREE_CODE (t1); code1 = TREE_CODE (t1);
code2 = TREE_CODE (t2); code2 = TREE_CODE (t2);
if (code1 != VECTOR_TYPE && code1 != COMPLEX_TYPE gcc_assert (code1 == VECTOR_TYPE || code1 == COMPLEX_TYPE
&& code1 != REAL_TYPE && code1 != INTEGER_TYPE) || code1 == REAL_TYPE || code1 == INTEGER_TYPE);
abort (); gcc_assert (code2 == VECTOR_TYPE || code2 == COMPLEX_TYPE
|| code2 == REAL_TYPE || code2 == INTEGER_TYPE);
if (code2 != VECTOR_TYPE && code2 != COMPLEX_TYPE
&& code2 != REAL_TYPE && code2 != INTEGER_TYPE)
abort ();
/* If one type is a vector type, return that type. (How the usual /* If one type is a vector type, return that type. (How the usual
arithmetic conversions apply to the vector types extension is not arithmetic conversions apply to the vector types extension is not
...@@ -744,7 +739,7 @@ same_translation_unit_p (tree t1, tree t2) ...@@ -744,7 +739,7 @@ same_translation_unit_p (tree t1, tree t2)
case 'd': t1 = DECL_CONTEXT (t1); break; case 'd': t1 = DECL_CONTEXT (t1); break;
case 't': t1 = TYPE_CONTEXT (t1); break; case 't': t1 = TYPE_CONTEXT (t1); break;
case 'x': t1 = BLOCK_SUPERCONTEXT (t1); break; /* assume block */ case 'x': t1 = BLOCK_SUPERCONTEXT (t1); break; /* assume block */
default: abort (); default: gcc_unreachable ();
} }
while (t2 && TREE_CODE (t2) != TRANSLATION_UNIT_DECL) while (t2 && TREE_CODE (t2) != TRANSLATION_UNIT_DECL)
...@@ -753,7 +748,7 @@ same_translation_unit_p (tree t1, tree t2) ...@@ -753,7 +748,7 @@ same_translation_unit_p (tree t1, tree t2)
case 'd': t2 = DECL_CONTEXT (t2); break; case 'd': t2 = DECL_CONTEXT (t2); break;
case 't': t2 = TYPE_CONTEXT (t2); break; case 't': t2 = TYPE_CONTEXT (t2); break;
case 'x': t2 = BLOCK_SUPERCONTEXT (t2); break; /* assume block */ case 'x': t2 = BLOCK_SUPERCONTEXT (t2); break; /* assume block */
default: abort (); default: gcc_unreachable ();
} }
return t1 == t2; return t1 == t2;
...@@ -935,7 +930,7 @@ tagged_types_tu_compatible_p (tree t1, tree t2) ...@@ -935,7 +930,7 @@ tagged_types_tu_compatible_p (tree t1, tree t2)
} }
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -4371,8 +4366,7 @@ finish_init (void) ...@@ -4371,8 +4366,7 @@ finish_init (void)
free (q); free (q);
} }
if (constructor_range_stack) gcc_assert (!constructor_range_stack);
abort ();
/* Pop back to the data of the outer initializer (if any). */ /* Pop back to the data of the outer initializer (if any). */
free (spelling_base); free (spelling_base);
...@@ -4716,8 +4710,7 @@ pop_init_level (int implicit) ...@@ -4716,8 +4710,7 @@ pop_init_level (int implicit)
while (constructor_stack->implicit) while (constructor_stack->implicit)
process_init_element (pop_init_level (1)); process_init_element (pop_init_level (1));
if (constructor_range_stack) gcc_assert (!constructor_range_stack);
abort ();
} }
/* Now output all pending elements. */ /* Now output all pending elements. */
...@@ -4737,8 +4730,10 @@ pop_init_level (int implicit) ...@@ -4737,8 +4730,10 @@ pop_init_level (int implicit)
already have pedwarned for empty brackets. */ already have pedwarned for empty brackets. */
if (integer_zerop (constructor_unfilled_index)) if (integer_zerop (constructor_unfilled_index))
constructor_type = NULL_TREE; constructor_type = NULL_TREE;
else if (! TYPE_SIZE (constructor_type)) else
{ {
gcc_assert (!TYPE_SIZE (constructor_type));
if (constructor_depth > 2) if (constructor_depth > 2)
error_init ("initialization of flexible array member in a nested context"); error_init ("initialization of flexible array member in a nested context");
else if (pedantic) else if (pedantic)
...@@ -4750,10 +4745,6 @@ pop_init_level (int implicit) ...@@ -4750,10 +4745,6 @@ pop_init_level (int implicit)
if (TREE_CHAIN (constructor_fields) != NULL_TREE) if (TREE_CHAIN (constructor_fields) != NULL_TREE)
constructor_type = NULL_TREE; constructor_type = NULL_TREE;
} }
else
/* Zero-length arrays are no longer special, so we should no longer
get here. */
abort ();
} }
/* Warn when some struct elements are implicitly initialized to zero. */ /* Warn when some struct elements are implicitly initialized to zero. */
...@@ -4869,14 +4860,14 @@ set_designator (int array) ...@@ -4869,14 +4860,14 @@ set_designator (int array)
if (constructor_type == 0) if (constructor_type == 0)
return 1; return 1;
/* If there were errors in this designator list already, bail out silently. */ /* If there were errors in this designator list already, bail out
silently. */
if (designator_errorneous) if (designator_errorneous)
return 1; return 1;
if (!designator_depth) if (!designator_depth)
{ {
if (constructor_range_stack) gcc_assert (!constructor_range_stack);
abort ();
/* Designator list starts at the level of closest explicit /* Designator list starts at the level of closest explicit
braces. */ braces. */
...@@ -4892,19 +4883,20 @@ set_designator (int array) ...@@ -4892,19 +4883,20 @@ set_designator (int array)
return 1; return 1;
} }
if (TREE_CODE (constructor_type) == RECORD_TYPE switch (TREE_CODE (constructor_type))
|| TREE_CODE (constructor_type) == UNION_TYPE)
{ {
case RECORD_TYPE:
case UNION_TYPE:
subtype = TREE_TYPE (constructor_fields); subtype = TREE_TYPE (constructor_fields);
if (subtype != error_mark_node) if (subtype != error_mark_node)
subtype = TYPE_MAIN_VARIANT (subtype); subtype = TYPE_MAIN_VARIANT (subtype);
} break;
else if (TREE_CODE (constructor_type) == ARRAY_TYPE) case ARRAY_TYPE:
{
subtype = TYPE_MAIN_VARIANT (TREE_TYPE (constructor_type)); subtype = TYPE_MAIN_VARIANT (TREE_TYPE (constructor_type));
break;
default:
gcc_unreachable ();
} }
else
abort ();
subcode = TREE_CODE (subtype); subcode = TREE_CODE (subtype);
if (array && subcode != ARRAY_TYPE) if (array && subcode != ARRAY_TYPE)
...@@ -5324,18 +5316,17 @@ set_nonincremental_init_from_string (tree str) ...@@ -5324,18 +5316,17 @@ set_nonincremental_init_from_string (tree str)
const char *p, *end; const char *p, *end;
int byte, wchar_bytes, charwidth, bitpos; int byte, wchar_bytes, charwidth, bitpos;
if (TREE_CODE (constructor_type) != ARRAY_TYPE) gcc_assert (TREE_CODE (constructor_type) == ARRAY_TYPE);
abort ();
if (TYPE_PRECISION (TREE_TYPE (TREE_TYPE (str))) if (TYPE_PRECISION (TREE_TYPE (TREE_TYPE (str)))
== TYPE_PRECISION (char_type_node)) == TYPE_PRECISION (char_type_node))
wchar_bytes = 1; wchar_bytes = 1;
else if (TYPE_PRECISION (TREE_TYPE (TREE_TYPE (str)))
== TYPE_PRECISION (wchar_type_node))
wchar_bytes = TYPE_PRECISION (wchar_type_node) / BITS_PER_UNIT;
else else
abort (); {
gcc_assert (TYPE_PRECISION (TREE_TYPE (TREE_TYPE (str)))
== TYPE_PRECISION (wchar_type_node));
wchar_bytes = TYPE_PRECISION (wchar_type_node) / BITS_PER_UNIT;
}
charwidth = TYPE_PRECISION (char_type_node); charwidth = TYPE_PRECISION (char_type_node);
type = TREE_TYPE (constructor_type); type = TREE_TYPE (constructor_type);
p = TREE_STRING_POINTER (str); p = TREE_STRING_POINTER (str);
...@@ -6077,16 +6068,14 @@ process_init_element (struct c_expr value) ...@@ -6077,16 +6068,14 @@ process_init_element (struct c_expr value)
constructor_range_stack = 0; constructor_range_stack = 0;
while (constructor_stack != range_stack->stack) while (constructor_stack != range_stack->stack)
{ {
if (!constructor_stack->implicit) gcc_assert (constructor_stack->implicit);
abort ();
process_init_element (pop_init_level (1)); process_init_element (pop_init_level (1));
} }
for (p = range_stack; for (p = range_stack;
!p->range_end || tree_int_cst_equal (p->index, p->range_end); !p->range_end || tree_int_cst_equal (p->index, p->range_end);
p = p->prev) p = p->prev)
{ {
if (!constructor_stack->implicit) gcc_assert (constructor_stack->implicit);
abort ();
process_init_element (pop_init_level (1)); process_init_element (pop_init_level (1));
} }
...@@ -6471,7 +6460,7 @@ c_finish_if_stmt (location_t if_locus, tree cond, tree then_block, ...@@ -6471,7 +6460,7 @@ c_finish_if_stmt (location_t if_locus, tree cond, tree then_block,
inner_if = TREE_OPERAND (inner_if, 0); inner_if = TREE_OPERAND (inner_if, 0);
break; break;
default: default:
abort (); gcc_unreachable ();
} }
found: found:
......
...@@ -160,8 +160,7 @@ init_caller_save (void) ...@@ -160,8 +160,7 @@ init_caller_save (void)
[(int) MODE_BASE_REG_CLASS (regno_save_mode [i][1])], i)) [(int) MODE_BASE_REG_CLASS (regno_save_mode [i][1])], i))
break; break;
if (i == FIRST_PSEUDO_REGISTER) gcc_assert (i < FIRST_PSEUDO_REGISTER);
abort ();
addr_reg = gen_rtx_REG (Pmode, i); addr_reg = gen_rtx_REG (Pmode, i);
...@@ -381,8 +380,7 @@ save_call_clobbered_regs (void) ...@@ -381,8 +380,7 @@ save_call_clobbered_regs (void)
next = chain->next; next = chain->next;
if (chain->is_caller_save_insn) gcc_assert (!chain->is_caller_save_insn);
abort ();
if (INSN_P (insn)) if (INSN_P (insn))
{ {
...@@ -431,22 +429,17 @@ save_call_clobbered_regs (void) ...@@ -431,22 +429,17 @@ save_call_clobbered_regs (void)
{ {
int r = reg_renumber[regno]; int r = reg_renumber[regno];
int nregs; int nregs;
enum machine_mode mode;
if (r >= 0)
{ gcc_assert (r >= 0);
enum machine_mode mode; nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)];
mode = HARD_REGNO_CALLER_SAVE_MODE
nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)]; (r, nregs, PSEUDO_REGNO_MODE (regno));
mode = HARD_REGNO_CALLER_SAVE_MODE if (GET_MODE_BITSIZE (mode)
(r, nregs, PSEUDO_REGNO_MODE (regno)); > GET_MODE_BITSIZE (save_mode[r]))
if (GET_MODE_BITSIZE (mode) save_mode[r] = mode;
> GET_MODE_BITSIZE (save_mode[r])) while (nregs-- > 0)
save_mode[r] = mode; SET_HARD_REG_BIT (hard_regs_to_save, r + nregs);
while (nregs-- > 0)
SET_HARD_REG_BIT (hard_regs_to_save, r + nregs);
}
else
abort ();
}); });
/* Record all registers set in this call insn. These don't need /* Record all registers set in this call insn. These don't need
...@@ -650,9 +643,7 @@ insert_restore (struct insn_chain *chain, int before_p, int regno, ...@@ -650,9 +643,7 @@ insert_restore (struct insn_chain *chain, int before_p, int regno,
or SET_SRC. Instead of doing so and causing a crash later, check or SET_SRC. Instead of doing so and causing a crash later, check
for this common case and abort here instead. This will remove one for this common case and abort here instead. This will remove one
step in debugging such problems. */ step in debugging such problems. */
gcc_assert (regno_save_mem[regno][1]);
if (regno_save_mem[regno][1] == 0)
abort ();
/* Get the pattern to emit and update our status. /* Get the pattern to emit and update our status.
...@@ -725,9 +716,7 @@ insert_save (struct insn_chain *chain, int before_p, int regno, ...@@ -725,9 +716,7 @@ insert_save (struct insn_chain *chain, int before_p, int regno,
or SET_SRC. Instead of doing so and causing a crash later, check or SET_SRC. Instead of doing so and causing a crash later, check
for this common case and abort here instead. This will remove one for this common case and abort here instead. This will remove one
step in debugging such problems. */ step in debugging such problems. */
gcc_assert (regno_save_mem[regno][1]);
if (regno_save_mem[regno][1] == 0)
abort ();
/* Get the pattern to emit and update our status. /* Get the pattern to emit and update our status.
...@@ -824,9 +813,7 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat) ...@@ -824,9 +813,7 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat)
rtx reg = XEXP (link, 0); rtx reg = XEXP (link, 0);
int regno, i; int regno, i;
if (!REG_P (reg)) gcc_assert (REG_P (reg));
abort ();
regno = REGNO (reg); regno = REGNO (reg);
if (regno >= FIRST_PSEUDO_REGISTER) if (regno >= FIRST_PSEUDO_REGISTER)
regno = reg_renumber[regno]; regno = reg_renumber[regno];
......
...@@ -349,7 +349,7 @@ emit_call_1 (rtx funexp, tree fntree, tree fndecl ATTRIBUTE_UNUSED, ...@@ -349,7 +349,7 @@ emit_call_1 (rtx funexp, tree fntree, tree fndecl ATTRIBUTE_UNUSED,
} }
else else
#endif #endif
abort (); gcc_unreachable ();
/* Find the call we just emitted. */ /* Find the call we just emitted. */
call_insn = last_call_insn (); call_insn = last_call_insn ();
...@@ -1158,8 +1158,7 @@ compute_argument_block_size (int reg_parm_stack_space, ...@@ -1158,8 +1158,7 @@ compute_argument_block_size (int reg_parm_stack_space,
/* We don't handle this case yet. To handle it correctly we have /* We don't handle this case yet. To handle it correctly we have
to add the delta, round and subtract the delta. to add the delta, round and subtract the delta.
Currently no machine description requires this support. */ Currently no machine description requires this support. */
if (stack_pointer_delta & (preferred_stack_boundary - 1)) gcc_assert (!(stack_pointer_delta & (preferred_stack_boundary - 1)));
abort ();
args_size->var = round_up (args_size->var, preferred_stack_boundary); args_size->var = round_up (args_size->var, preferred_stack_boundary);
} }
...@@ -1225,8 +1224,7 @@ precompute_arguments (int flags, int num_actuals, struct arg_data *args) ...@@ -1225,8 +1224,7 @@ precompute_arguments (int flags, int num_actuals, struct arg_data *args)
enum machine_mode mode; enum machine_mode mode;
/* If this is an addressable type, we cannot pre-evaluate it. */ /* If this is an addressable type, we cannot pre-evaluate it. */
if (TREE_ADDRESSABLE (TREE_TYPE (args[i].tree_value))) gcc_assert (!TREE_ADDRESSABLE (TREE_TYPE (args[i].tree_value)));
abort ();
args[i].initial_value = args[i].value args[i].initial_value = args[i].value
= expand_expr (args[i].tree_value, NULL_RTX, VOIDmode, 0); = expand_expr (args[i].tree_value, NULL_RTX, VOIDmode, 0);
...@@ -1999,8 +1997,7 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -1999,8 +1997,7 @@ expand_call (tree exp, rtx target, int ignore)
/* Operand 0 is a pointer-to-function; get the type of the function. */ /* Operand 0 is a pointer-to-function; get the type of the function. */
funtype = TREE_TYPE (addr); funtype = TREE_TYPE (addr);
if (! POINTER_TYPE_P (funtype)) gcc_assert (POINTER_TYPE_P (funtype));
abort ();
funtype = TREE_TYPE (funtype); funtype = TREE_TYPE (funtype);
/* Munge the tree to split complex arguments into their imaginary /* Munge the tree to split complex arguments into their imaginary
...@@ -2641,8 +2638,8 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -2641,8 +2638,8 @@ expand_call (tree exp, rtx target, int ignore)
now! */ now! */
/* Stack must be properly aligned now. */ /* Stack must be properly aligned now. */
if (pass && stack_pointer_delta % preferred_unit_stack_boundary) gcc_assert (!pass
abort (); || !(stack_pointer_delta % preferred_unit_stack_boundary));
/* Generate the actual call instruction. */ /* Generate the actual call instruction. */
emit_call_1 (funexp, exp, fndecl, funtype, unadjusted_args_size, emit_call_1 (funexp, exp, fndecl, funtype, unadjusted_args_size,
...@@ -2754,8 +2751,7 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -2754,8 +2751,7 @@ expand_call (tree exp, rtx target, int ignore)
{ {
last = PREV_INSN (last); last = PREV_INSN (last);
/* There was no CALL_INSN? */ /* There was no CALL_INSN? */
if (last == before_call) gcc_assert (last != before_call);
abort ();
} }
emit_barrier_after (last); emit_barrier_after (last);
...@@ -2855,36 +2851,36 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -2855,36 +2851,36 @@ expand_call (tree exp, rtx target, int ignore)
if (targetm.calls.promote_function_return(funtype)) if (targetm.calls.promote_function_return(funtype))
{ {
/* If we promoted this return value, make the proper SUBREG. TARGET /* If we promoted this return value, make the proper SUBREG.
might be const0_rtx here, so be careful. */ TARGET might be const0_rtx here, so be careful. */
if (REG_P (target) if (REG_P (target)
&& TYPE_MODE (TREE_TYPE (exp)) != BLKmode && TYPE_MODE (TREE_TYPE (exp)) != BLKmode
&& GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp))) && GET_MODE (target) != TYPE_MODE (TREE_TYPE (exp)))
{ {
tree type = TREE_TYPE (exp); tree type = TREE_TYPE (exp);
int unsignedp = TYPE_UNSIGNED (type); int unsignedp = TYPE_UNSIGNED (type);
int offset = 0; int offset = 0;
enum machine_mode pmode;
/* If we don't promote as expected, something is wrong. */
if (GET_MODE (target) pmode = promote_mode (type, TYPE_MODE (type), &unsignedp, 1);
!= promote_mode (type, TYPE_MODE (type), &unsignedp, 1)) /* If we don't promote as expected, something is wrong. */
abort (); gcc_assert (GET_MODE (target) == pmode);
if ((WORDS_BIG_ENDIAN || BYTES_BIG_ENDIAN) if ((WORDS_BIG_ENDIAN || BYTES_BIG_ENDIAN)
&& GET_MODE_SIZE (GET_MODE (target)) && (GET_MODE_SIZE (GET_MODE (target))
> GET_MODE_SIZE (TYPE_MODE (type))) > GET_MODE_SIZE (TYPE_MODE (type))))
{ {
offset = GET_MODE_SIZE (GET_MODE (target)) offset = GET_MODE_SIZE (GET_MODE (target))
- GET_MODE_SIZE (TYPE_MODE (type)); - GET_MODE_SIZE (TYPE_MODE (type));
if (! BYTES_BIG_ENDIAN) if (! BYTES_BIG_ENDIAN)
offset = (offset / UNITS_PER_WORD) * UNITS_PER_WORD; offset = (offset / UNITS_PER_WORD) * UNITS_PER_WORD;
else if (! WORDS_BIG_ENDIAN) else if (! WORDS_BIG_ENDIAN)
offset %= UNITS_PER_WORD; offset %= UNITS_PER_WORD;
} }
target = gen_rtx_SUBREG (TYPE_MODE (type), target, offset); target = gen_rtx_SUBREG (TYPE_MODE (type), target, offset);
SUBREG_PROMOTED_VAR_P (target) = 1; SUBREG_PROMOTED_VAR_P (target) = 1;
SUBREG_PROMOTED_UNSIGNED_SET (target, unsignedp); SUBREG_PROMOTED_UNSIGNED_SET (target, unsignedp);
} }
} }
/* If size of args is variable or this was a constructor call for a stack /* If size of args is variable or this was a constructor call for a stack
...@@ -2971,10 +2967,9 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -2971,10 +2967,9 @@ expand_call (tree exp, rtx target, int ignore)
normal_call_insns = insns; normal_call_insns = insns;
/* Verify that we've deallocated all the stack we used. */ /* Verify that we've deallocated all the stack we used. */
if (! (flags & (ECF_NORETURN | ECF_LONGJMP)) gcc_assert ((flags & (ECF_NORETURN | ECF_LONGJMP))
&& old_stack_allocated != stack_pointer_delta || (old_stack_allocated
- pending_stack_adjust) == stack_pointer_delta - pending_stack_adjust));
abort ();
} }
/* If something prevents making this a sibling call, /* If something prevents making this a sibling call,
...@@ -3286,6 +3281,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, ...@@ -3286,6 +3281,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
if (mem_value && struct_value == 0 && ! pcc_struct_value) if (mem_value && struct_value == 0 && ! pcc_struct_value)
{ {
rtx addr = XEXP (mem_value, 0); rtx addr = XEXP (mem_value, 0);
int partial;
nargs++; nargs++;
/* Make sure it is a reasonable operand for a move or push insn. */ /* Make sure it is a reasonable operand for a move or push insn. */
...@@ -3298,8 +3295,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, ...@@ -3298,8 +3295,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
argvec[count].partial = 0; argvec[count].partial = 0;
argvec[count].reg = FUNCTION_ARG (args_so_far, Pmode, NULL_TREE, 1); argvec[count].reg = FUNCTION_ARG (args_so_far, Pmode, NULL_TREE, 1);
if (FUNCTION_ARG_PARTIAL_NREGS (args_so_far, Pmode, NULL_TREE, 1)) partial = FUNCTION_ARG_PARTIAL_NREGS (args_so_far, Pmode, NULL_TREE, 1);
abort (); gcc_assert (!partial);
locate_and_pad_parm (Pmode, NULL_TREE, locate_and_pad_parm (Pmode, NULL_TREE,
#ifdef STACK_PARMS_IN_REG_PARM_AREA #ifdef STACK_PARMS_IN_REG_PARM_AREA
...@@ -3325,9 +3322,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, ...@@ -3325,9 +3322,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
/* We cannot convert the arg value to the mode the library wants here; /* We cannot convert the arg value to the mode the library wants here;
must do it earlier where we know the signedness of the arg. */ must do it earlier where we know the signedness of the arg. */
if (mode == BLKmode gcc_assert (mode != BLKmode
|| (GET_MODE (val) != mode && GET_MODE (val) != VOIDmode)) && (GET_MODE (val) == mode || GET_MODE (val) == VOIDmode));
abort ();
/* Make sure it is a reasonable operand for a move or push insn. */ /* Make sure it is a reasonable operand for a move or push insn. */
if (!REG_P (val) && !MEM_P (val) if (!REG_P (val) && !MEM_P (val)
...@@ -3397,8 +3393,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, ...@@ -3397,8 +3393,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
argvec[count].partial, argvec[count].partial,
NULL_TREE, &args_size, &argvec[count].locate); NULL_TREE, &args_size, &argvec[count].locate);
if (argvec[count].locate.size.var) gcc_assert (!argvec[count].locate.size.var);
abort ();
if (argvec[count].reg == 0 || argvec[count].partial != 0 if (argvec[count].reg == 0 || argvec[count].partial != 0
|| reg_parm_stack_space > 0) || reg_parm_stack_space > 0)
...@@ -3662,8 +3657,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, ...@@ -3662,8 +3657,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
? hard_libcall_value (outmode) : NULL_RTX); ? hard_libcall_value (outmode) : NULL_RTX);
/* Stack must be properly aligned now. */ /* Stack must be properly aligned now. */
if (stack_pointer_delta & (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT - 1)) gcc_assert (!(stack_pointer_delta
abort (); & (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT - 1)));
before_call = get_last_insn (); before_call = get_last_insn ();
...@@ -3698,8 +3693,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, ...@@ -3698,8 +3693,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
{ {
last = PREV_INSN (last); last = PREV_INSN (last);
/* There was no CALL_INSN? */ /* There was no CALL_INSN? */
if (last == before_call) gcc_assert (last != before_call);
abort ();
} }
emit_barrier_after (last); emit_barrier_after (last);
...@@ -3975,11 +3969,10 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, ...@@ -3975,11 +3969,10 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags,
partial = arg->partial; partial = arg->partial;
} }
if (reg != 0 && partial == 0) /* Being passed entirely in a register. We shouldn't be called in
/* Being passed entirely in a register. We shouldn't be called in this case. */
this case. */ gcc_assert (reg == 0 || partial != 0);
abort ();
/* If this arg needs special alignment, don't load the registers /* If this arg needs special alignment, don't load the registers
here. */ here. */
if (arg->n_aligned_regs != 0) if (arg->n_aligned_regs != 0)
...@@ -4151,8 +4144,8 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, ...@@ -4151,8 +4144,8 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags,
i = INTVAL (XEXP (XEXP (x, 0), 1)); i = INTVAL (XEXP (XEXP (x, 0), 1));
/* expand_call should ensure this. */ /* expand_call should ensure this. */
if (arg->locate.offset.var || GET_CODE (size_rtx) != CONST_INT) gcc_assert (!arg->locate.offset.var
abort (); && GET_CODE (size_rtx) == CONST_INT);
if (arg->locate.offset.constant > i) if (arg->locate.offset.constant > i)
{ {
......
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