aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-09-07 10:19:00 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2004-09-07 10:19:00 +0000
commit366de0ce7d916d313aba839a2802cfbc70b991cf (patch)
treedd4f142a645a4fabe170becf3c587e3d8176358c /gcc/c-common.c
parente1bbfc5cc2dd0458d1350df2e9055ef9d213d159 (diff)
downloadgcc-366de0ce7d916d313aba839a2802cfbc70b991cf.zip
gcc-366de0ce7d916d313aba839a2802cfbc70b991cf.tar.gz
gcc-366de0ce7d916d313aba839a2802cfbc70b991cf.tar.bz2
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
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index e1fa8e4..b7aa389 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -2578,7 +2578,7 @@ c_type_hash (const void *p)
t2 = TYPE_FIELDS (t);
break;
default:
- abort ();
+ gcc_unreachable ();
}
for (; t2; t2 = TREE_CHAIN (t2))
i++;
@@ -3188,8 +3188,8 @@ c_common_nodes_and_builtins (void)
{ \
tree decl; \
\
- if (strncmp (NAME, "__builtin_", strlen ("__builtin_")) != 0) \
- abort (); \
+ gcc_assert (!strncmp (NAME, "__builtin_", \
+ strlen ("__builtin_"))); \
\
if (!BOTH_P) \
decl = lang_hooks.builtin_function (NAME, builtin_types[TYPE], \
@@ -3830,7 +3830,7 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode,
}
default:
- abort ();
+ gcc_unreachable ();
}
}
@@ -3878,7 +3878,7 @@ boolean_increment (enum tree_code code, tree arg)
val = build2 (COMPOUND_EXPR, TREE_TYPE (arg), arg, val);
break;
default:
- abort ();
+ gcc_unreachable ();
}
TREE_SIDE_EFFECTS (val) = 1;
return val;
@@ -5111,8 +5111,9 @@ nonnull_check_p (tree args, unsigned HOST_WIDE_INT param_num)
for (; args; args = TREE_CHAIN (args))
{
- if (! get_nonnull_operand (TREE_VALUE (args), &arg_num))
- abort ();
+ bool found = get_nonnull_operand (TREE_VALUE (args), &arg_num);
+
+ gcc_assert (found);
if (arg_num == param_num)
return true;
@@ -5356,9 +5357,8 @@ check_function_arguments_recurse (void (*callback)
|| TREE_CODE (format_num_expr) == NON_LVALUE_EXPR)
format_num_expr = TREE_OPERAND (format_num_expr, 0);
- if (TREE_CODE (format_num_expr) != INTEGER_CST
- || TREE_INT_CST_HIGH (format_num_expr) != 0)
- abort ();
+ gcc_assert (TREE_CODE (format_num_expr) == INTEGER_CST
+ && !TREE_INT_CST_HIGH (format_num_expr));
format_num = TREE_INT_CST_LOW (format_num_expr);
@@ -5619,7 +5619,7 @@ fold_offsetof_1 (tree expr)
break;
default:
- abort ();
+ gcc_unreachable ();
}
return size_binop (code, base, off);