diff options
author | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-08-30 19:13:03 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-08-30 19:13:03 +0000 |
commit | 298e6adcf212620192ae9b66c27b4eae64916e7b (patch) | |
tree | fff62e6c69665ec9937365c779e5da53606f6d80 /gcc/attribs.c | |
parent | 0de4325e0bc2e0601e49ac8e85ca9a7134e50198 (diff) | |
download | gcc-298e6adcf212620192ae9b66c27b4eae64916e7b.zip gcc-298e6adcf212620192ae9b66c27b4eae64916e7b.tar.gz gcc-298e6adcf212620192ae9b66c27b4eae64916e7b.tar.bz2 |
alias.c (mems_in_disjoint_alias_sets_p, [...]): Use gcc_assert and gcc_unreachable instead of abort.
* alias.c (mems_in_disjoint_alias_sets_p, record_alias_subset,
record_set, rtx_equal_for_memref_p, init_alias_analysis): Use
gcc_assert and gcc_unreachable instead of abort.
* alloc-pool.c (abort, fancy_abort): Remove.
(create_alloc_pool, free_alloc_pool, pool_alloc, pool_free): Use
gcc_assert or gcc_unreachable.
* attribs.c (init_attributes, decl_attributes): Likewise.
* bb-reorder.c (FREE, find_traces_1_round, copy_bb,
mark_bb_for_unlikely_executed_section,
add_labels_and_missing_jumps, fix_crossing_conditional_branches,
fix_crossing_unconditional_branches): Likewise.
* bitmap.c (bitmap_first_set_bit, bitmap_last_set_bit,
bitmap_operation): Likewise.
* bt-load.c (insn_sets_btr_p, augment_live_range,
move_btr_def): Likewise.
* builtins.c (c_readstr, expand_builtin_longjmp, apply_args_size,
apply_result_size, expand_builtin_apply, expand_builtin_mathfn,
expand_builtin_mathfn_2, expand_builtin_mathfn_3,
builtin_memcpy_read_str, expand_movstr, expand_builtin_stpcpy,
expand_builtin_memcmp, expand_builtin_args_info,
std_gimplify_va_arg_expr, expand_builtin_unop,
expand_builtin_fputs, expand_builtin_profile_func,
expand_builtin_fork_or_exec, fold_builtin_bitop,
fold_builtin_classify, fold_builtin_fputs): Likewise.
From-SVN: r86797
Diffstat (limited to 'gcc/attribs.c')
-rw-r--r-- | gcc/attribs.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/gcc/attribs.c b/gcc/attribs.c index cbfe664..8174f39 100644 --- a/gcc/attribs.c +++ b/gcc/attribs.c @@ -77,25 +77,25 @@ init_attributes (void) /* The name must not begin and end with __. */ const char *name = attribute_tables[i][j].name; int len = strlen (name); - if (name[0] == '_' && name[1] == '_' - && name[len - 1] == '_' && name[len - 2] == '_') - abort (); + + gcc_assert (!(name[0] == '_' && name[1] == '_' + && name[len - 1] == '_' && name[len - 2] == '_')); + /* The minimum and maximum lengths must be consistent. */ - if (attribute_tables[i][j].min_length < 0) - abort (); - if (attribute_tables[i][j].max_length != -1 - && (attribute_tables[i][j].max_length - < attribute_tables[i][j].min_length)) - abort (); + gcc_assert (attribute_tables[i][j].min_length >= 0); + + gcc_assert (attribute_tables[i][j].max_length == -1 + || (attribute_tables[i][j].max_length + >= attribute_tables[i][j].min_length)); + /* An attribute cannot require both a DECL and a TYPE. */ - if (attribute_tables[i][j].decl_required - && attribute_tables[i][j].type_required) - abort (); + gcc_assert (!attribute_tables[i][j].decl_required + || !attribute_tables[i][j].type_required); + /* If an attribute requires a function type, in particular it requires a type. */ - if (attribute_tables[i][j].function_type_required - && !attribute_tables[i][j].type_required) - abort (); + gcc_assert (!attribute_tables[i][j].function_type_required + || attribute_tables[i][j].type_required); } } @@ -105,9 +105,8 @@ init_attributes (void) int j, k; for (j = 0; attribute_tables[i][j].name != NULL; j++) for (k = j + 1; attribute_tables[i][k].name != NULL; k++) - if (!strcmp (attribute_tables[i][j].name, - attribute_tables[i][k].name)) - abort (); + gcc_assert (strcmp (attribute_tables[i][j].name, + attribute_tables[i][k].name)); } /* Check that no name occurs in more than one table. */ for (i = 0; i < ARRAY_SIZE (attribute_tables); i++) @@ -117,9 +116,8 @@ init_attributes (void) for (j = i + 1; j < ARRAY_SIZE (attribute_tables); j++) for (k = 0; attribute_tables[i][k].name != NULL; k++) for (l = 0; attribute_tables[j][l].name != NULL; l++) - if (!strcmp (attribute_tables[i][k].name, - attribute_tables[j][l].name)) - abort (); + gcc_assert (strcmp (attribute_tables[i][k].name, + attribute_tables[j][l].name)); } #endif @@ -327,10 +325,11 @@ decl_attributes (tree *node, tree attributes, int flags) fn_ptr_tmp = build_pointer_type (fn_ptr_tmp); if (DECL_P (*node)) TREE_TYPE (*node) = fn_ptr_tmp; - else if (TREE_CODE (*node) == POINTER_TYPE) - *node = fn_ptr_tmp; else - abort (); + { + gcc_assert (TREE_CODE (*node) == POINTER_TYPE); + *node = fn_ptr_tmp; + } } } |