From e16acfcd1431d5448b7e958ab72f783e1f0f1263 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Sun, 3 Apr 2005 10:27:51 +0000 Subject: params.c (set_param_value): Use gcc_assert & gcc_unreachable. * params.c (set_param_value): Use gcc_assert & gcc_unreachable. * passes.c (open_dump_file, rest_of_handle_final): Likewise. * postreload-gcse.c (expr_equiv_p, oprs_unchanged_p, hash_scan_set, reg_set_between_after_reload_p, reg_used_between_after_reload_p, get_avail_load_store_reg, eliminate_partially_redundant_load): Likewise. * postreload.c (reload_cse_simplify_set, reload_combine_note_use): Likewise. * predict.c (predict_insn, expected_value_to_br_prob, propagate_freq, expensive_function_p): Likewise. * print-rtl.c (print_rtx): Likewise. * profile.c (instrument_edges, instrument_values, compute_branch_probabilities, branch_prob, union_groups, tree_register_profile_hooks, rtl_register_profile_hooks): Likewise. * protoize.c (in_system_include_dir, file_could_be_converted, file_normally_convertible, gen_aux_info_file, seek_to_line, do_cleaning): Likewise. * tree-ssa-alias.c (collect_points_to_info_r): Likewise. * tree-ssa-ccp.c (execute_fold_all_builtins): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. From-SVN: r97485 --- gcc/protoize.c | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) (limited to 'gcc/protoize.c') diff --git a/gcc/protoize.c b/gcc/protoize.c index 093e440..b9e100c 100644 --- a/gcc/protoize.c +++ b/gcc/protoize.c @@ -34,7 +34,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifdef HAVE_UNISTD_H #include #endif -#undef abort #include "version.h" /* Include getopt.h for the sake of getopt_long. */ @@ -641,8 +640,7 @@ in_system_include_dir (const char *path) { const struct default_include *p; - if (! IS_ABSOLUTE_PATH (path)) - abort (); /* Must be an absolutized filename. */ + gcc_assert (IS_ABSOLUTE_PATH (path)); for (p = cpp_include_defaults; p->fname; p++) if (!strncmp (path, p->fname, strlen (p->fname)) @@ -679,10 +677,8 @@ file_could_be_converted (const char *path) dir_last_slash = slash; } #endif - if (dir_last_slash) - *dir_last_slash = '\0'; - else - abort (); /* Should have been an absolutized filename. */ + gcc_assert (dir_last_slash); + *dir_last_slash = '\0'; } if (access (path, W_OK)) @@ -723,10 +719,8 @@ file_normally_convertible (const char *path) dir_last_slash = slash; } #endif - if (dir_last_slash) - *dir_last_slash = '\0'; - else - abort (); /* Should have been an absolutized filename. */ + gcc_assert (dir_last_slash); + *dir_last_slash = '\0'; } if (access (path, R_OK)) @@ -1930,7 +1924,7 @@ gen_aux_info_file (const char *base_filename) } return 1; } - abort (); + gcc_unreachable (); } } @@ -2742,8 +2736,7 @@ check_source (int cond, const char *clean_p) static const char * seek_to_line (int n) { - if (n < last_known_line_number) - abort (); + gcc_assert (n >= last_known_line_number); while (n > last_known_line_number) { @@ -3670,8 +3663,8 @@ do_cleaning (char *new_clean_text_base, const char *new_clean_text_limit) { if (!ISSPACE ((const unsigned char)*scan_p)) *scan_p = ' '; - if (++scan_p >= new_clean_text_limit) - abort (); + ++scan_p; + gcc_assert (scan_p < new_clean_text_limit); } *scan_p++ = ' '; *scan_p = ' '; @@ -3685,8 +3678,8 @@ do_cleaning (char *new_clean_text_base, const char *new_clean_text_limit) { if (!ISSPACE ((const unsigned char)*scan_p)) *scan_p = ' '; - if (++scan_p >= new_clean_text_limit) - abort (); + ++scan_p; + gcc_assert (scan_p < new_clean_text_limit); } *scan_p++ = ' '; break; @@ -3700,8 +3693,8 @@ do_cleaning (char *new_clean_text_base, const char *new_clean_text_limit) scan_p[1] = ' '; if (!ISSPACE ((const unsigned char)*scan_p)) *scan_p = ' '; - if (++scan_p >= new_clean_text_limit) - abort (); + ++scan_p; + gcc_assert (scan_p < new_clean_text_limit); } *scan_p++ = ' '; break; @@ -3715,8 +3708,8 @@ do_cleaning (char *new_clean_text_base, const char *new_clean_text_limit) scan_p[1] = ' '; if (!ISSPACE ((const unsigned char)*scan_p)) *scan_p = ' '; - if (++scan_p >= new_clean_text_limit) - abort (); + ++scan_p; + gcc_assert (scan_p < new_clean_text_limit); } if (!ISSPACE ((const unsigned char)*scan_p)) *scan_p = ' '; -- cgit v1.1