Makefile.in (gengtype): Use $(BUILD_ERRORS).

* Makefile.in (gengtype): Use $(BUILD_ERRORS).
	(gengtype.o): Depend on errors.h.
	* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
	(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
	attr_alt_subset_p, attr_alt_subset_of_compl_p,
	attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
	write_test_expr, write_attr_value, write_eligible_delay,
	make_internal_attr, make_numeric_value): Likewise.
	* genautomata.c (regexp_name, get_str_vect,
	gen_presence_absence_set, automaton_decl_hash,
	automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
	decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
	process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
	test_unit_reserv, it_is_empty_reserv_sets,
	reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
	reserv_sets_and, output_cycle_reservs, get_free_state,
	intersected_state_reservs_p, states_union, remove_arc,
	copy_insn_regexp, transform_1, transform_2, transform_3,
	regexp_transform_func, store_alt_unit_usage,
	check_regexp_units_distribution, process_seq_for_forming_states,
	process_alts_for_forming_states, make_automaton,
	form_arcs_marked_by_insn, create_composed_state,
	set_out_arc_insns_equiv_num, partition_equiv_class,
	process_insn_equiv_class, set_insn_equiv_classes,
	units_to_automata_heuristic_distr, form_regexp,
	longest_path_length, output_dfa_max_issue_rate, add_vect,
	out_state_arcs_num, add_vect_el, output_trans_table,
	output_state_alts_table, output_dead_lock_vect,
	output_max_insn_queue_index_def,
	output_min_insn_conflict_delay_func,
	output_internal_insn_latency_func, output_print_reservation_func,
	output_cpu_unit_reservation_p, output_state_arcs,
	make_insn_alts_attr, make_internal_dfa_insn_code_attr,
	make_default_insn_latency_attr,
	form_important_insn_automata_lists): Likewise.
	* genemit.c (gen_exp, output_add_clobbers,
	output_added_clobbers_hard_reg_p): Likewise.
	* genextract.c (print_path, main): Likewise.
	* genflags.c (gen_macro): Likewise.
	* gengenrtl.c: Include errors.h
	(type_from_format, accessor_from_format): Likewise.
	* gengtype.c (get_file_basename, output_mangled_typename,
	walk_type, write_types_process_field,
	write_types_local_process_field): Likewise.
	* genmodes.c (complete_mode): Likewise.
	* genopinit.c (gen_insn): Likewise.
	* genoutput.c (output_insn_data, check_constraint_len,
	constraint_len): Likewise.
	* genpreds.c (add_mode_tests):Likewise.
	* gen-protos.c (add_hash): Likewise.
	* genrecog.c (find_operand, find_matching_operand,
	validate_pattern, add_to_sequence, maybe_both_true,
	nodes_identical_1, merge_trees, write_switch, write_cond,
	write_action, is_unconditional, make_insn_sequence,
	debug_decision_2): Likewise.
	* gensupport.c (is_predicable, collect_insn_data,
	alter_predicate_for_insn, maybe_eval_c_test): Likewise.

From-SVN: r87236
This commit is contained in:
Nathan Sidwell 2004-09-09 13:22:38 +00:00
parent 87022a6b0e
commit b2d59f6f77
16 changed files with 744 additions and 644 deletions

View File

@ -1,11 +1,73 @@
2004-09-09 Nathan Sidwell <nathan@codesourcery.com>
* Makefile.in (gengtype): Use $(BUILD_ERRORS).
(gengtype.o): Depend on errors.h.
* genattrtab.c (strcmp_check): Use gcc_assert and gcc_unreachable.
(attr_rtx_1, attr_printf, attr_copy_rtx, evaluate_eq_attr,
attr_alt_subset_p, attr_alt_subset_of_compl_p,
attr_alt_intersection, attr_alt_union, optimize_attrs, gen_insn,
write_test_expr, write_attr_value, write_eligible_delay,
make_internal_attr, make_numeric_value): Likewise.
* genautomata.c (regexp_name, get_str_vect,
gen_presence_absence_set, automaton_decl_hash,
automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash,
decl_eq_p, process_regexp, loop_in_regexp, check_loops_in_regexps,
process_regexp_cycles, reserv_sets_cmp, set_unit_reserv,
test_unit_reserv, it_is_empty_reserv_sets,
reserv_sets_are_intersected, reserv_sets_shift, reserv_sets_or,
reserv_sets_and, output_cycle_reservs, get_free_state,
intersected_state_reservs_p, states_union, remove_arc,
copy_insn_regexp, transform_1, transform_2, transform_3,
regexp_transform_func, store_alt_unit_usage,
check_regexp_units_distribution, process_seq_for_forming_states,
process_alts_for_forming_states, make_automaton,
form_arcs_marked_by_insn, create_composed_state,
set_out_arc_insns_equiv_num, partition_equiv_class,
process_insn_equiv_class, set_insn_equiv_classes,
units_to_automata_heuristic_distr, form_regexp,
longest_path_length, output_dfa_max_issue_rate, add_vect,
out_state_arcs_num, add_vect_el, output_trans_table,
output_state_alts_table, output_dead_lock_vect,
output_max_insn_queue_index_def,
output_min_insn_conflict_delay_func,
output_internal_insn_latency_func, output_print_reservation_func,
output_cpu_unit_reservation_p, output_state_arcs,
make_insn_alts_attr, make_internal_dfa_insn_code_attr,
make_default_insn_latency_attr,
form_important_insn_automata_lists): Likewise.
* genemit.c (gen_exp, output_add_clobbers,
output_added_clobbers_hard_reg_p): Likewise.
* genextract.c (print_path, main): Likewise.
* genflags.c (gen_macro): Likewise.
* gengenrtl.c: Include errors.h
(type_from_format, accessor_from_format): Likewise.
* gengtype.c (get_file_basename, output_mangled_typename,
walk_type, write_types_process_field,
write_types_local_process_field): Likewise.
* genmodes.c (complete_mode): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (output_insn_data, check_constraint_len,
constraint_len): Likewise.
* genpreds.c (add_mode_tests):Likewise.
* gen-protos.c (add_hash): Likewise.
* genrecog.c (find_operand, find_matching_operand,
validate_pattern, add_to_sequence, maybe_both_true,
nodes_identical_1, merge_trees, write_switch, write_cond,
write_action, is_unconditional, make_insn_sequence,
debug_decision_2): Likewise.
* gensupport.c (is_predicable, collect_insn_data,
alter_predicate_for_insn, maybe_eval_c_test): Likewise.
2004-09-09 Jan Hubicka <jh@suse.cz> 2004-09-09 Jan Hubicka <jh@suse.cz>
* basic-block.h (guess_outgoing_edge_probabilities): Declare. * basic-block.h (guess_outgoing_edge_probabilities): Declare.
* cfgbuild.c (compute_outgoing_frequencies): When probability is missing, * cfgbuild.c (compute_outgoing_frequencies): When probability is
guess it. missing, guess it.
(find_many_sub_basic_blocks): Do update profile only when it is present. (find_many_sub_basic_blocks): Do update profile only when it is
present.
* predict.c (set_even_probabilities): Break out from ... * predict.c (set_even_probabilities): Break out from ...
(combine_predictions_for_insn): ... here; deal with !can_predict_insn_p insns. (combine_predictions_for_insn): ... here; deal with
!can_predict_insn_p insns.
(combine_predictions_for_bb): Use set_even_probabilities. (combine_predictions_for_bb): Use set_even_probabilities.
(bb_estimate_probability_locally): Break out from .... (bb_estimate_probability_locally): Break out from ....
(estimate_probability): ... here. (estimate_probability): ... here.
@ -6720,7 +6782,7 @@
* config/i386/xmmintrin.h: Include <mm_malloc.h>. * config/i386/xmmintrin.h: Include <mm_malloc.h>.
2004-08-03 H.J. Lu <hongjiu.lu@intel.com> 2004-08-03 H.J. Lu <hongjiu.lu@intel.com>
Tanguy Fautrà <tfautre@pandora.be> Tanguy Fautrà <tfautre@pandora.be>
* config/i386/pmm_malloc.h: New file. * config/i386/pmm_malloc.h: New file.

View File

@ -2609,12 +2609,13 @@ genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
$(GTM_H) errors.h gensupport.h $(OBSTACK_H) $(GTM_H) errors.h gensupport.h $(OBSTACK_H)
gengtype$(build_exeext) : gengtype.o gengtype-lex.o gengtype-yacc.o \ gengtype$(build_exeext) : gengtype.o gengtype-lex.o gengtype-yacc.o \
$(BUILD_LIBDEPS) $(BUILD_LIBDEPS) $(BUILD_ERRORS)
$(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \ $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
gengtype.o gengtype-lex.o gengtype-yacc.o $(BUILD_LIBS) gengtype.o gengtype-lex.o gengtype-yacc.o $(BUILD_ERRORS) \
$(BUILD_LIBS)
gengtype.o : gengtype.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \ gengtype.o : gengtype.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
gengtype.h gtyp-gen.h rtl.def insn-notes.def gengtype.h gtyp-gen.h rtl.def insn-notes.def errors.h
gengtype-lex.o : gengtype-lex.c gengtype.h gengtype-yacc.h \ gengtype-lex.o : gengtype-lex.c gengtype.h gengtype-yacc.h \
$(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) vec.h $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) vec.h

View File

@ -21,7 +21,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "coretypes.h" #include "coretypes.h"
#include "tm.h" #include "tm.h"
#include "scan.h" #include "scan.h"
#undef abort
int verbose = 0; int verbose = 0;
const char *progname; const char *progname;
@ -48,8 +47,7 @@ add_hash (const char *fname)
for (;;) for (;;)
{ {
i = (i+1) % HASH_SIZE; i = (i+1) % HASH_SIZE;
if (i == i0) gcc_assert (i != i0);
abort ();
if (hash_tab[i] == 0) if (hash_tab[i] == 0)
break; break;
} }

View File

@ -102,9 +102,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#if 0 #if 0
#define strcmp_check(S1, S2) ((S1) == (S2) \ #define strcmp_check(S1, S2) ((S1) == (S2) \
? 0 \ ? 0 \
: (strcmp ((S1), (S2)) \ : (gcc_assert (strcmp ((S1), (S2))), 1))
? 1 \
: (abort (), 0)))
#else #else
#define strcmp_check(S1, S2) ((S1) != (S2)) #define strcmp_check(S1, S2) ((S1) != (S2))
#endif #endif
@ -596,7 +594,7 @@ attr_rtx_1 (enum rtx_code code, va_list p)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
return rt_val; return rt_val;
@ -633,8 +631,7 @@ attr_printf (unsigned int len, const char *fmt, ...)
va_start (p, fmt); va_start (p, fmt);
if (len > sizeof str - 1) /* Leave room for \0. */ gcc_assert (len < sizeof str); /* Leave room for \0. */
abort ();
vsprintf (str, fmt, p); vsprintf (str, fmt, p);
va_end (p); va_end (p);
@ -777,7 +774,7 @@ attr_copy_rtx (rtx orig)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
return copy; return copy;
@ -2002,23 +1999,23 @@ evaluate_eq_attr (rtx exp, rtx value, int insn_code, int insn_index)
rtx newexp; rtx newexp;
int i; int i;
if (GET_CODE (value) == CONST_STRING) switch (GET_CODE (value))
{ {
case CONST_STRING:
if (! strcmp_check (XSTR (value, 0), XSTR (exp, 1))) if (! strcmp_check (XSTR (value, 0), XSTR (exp, 1)))
newexp = true_rtx; newexp = true_rtx;
else else
newexp = false_rtx; newexp = false_rtx;
} break;
else if (GET_CODE (value) == SYMBOL_REF)
case SYMBOL_REF:
{ {
char *p; char *p;
char string[256]; char string[256];
if (GET_CODE (exp) != EQ_ATTR) gcc_assert (GET_CODE (exp) == EQ_ATTR);
abort (); gcc_assert (strlen (XSTR (exp, 0)) + strlen (XSTR (exp, 1)) + 2
<= 256);
if (strlen (XSTR (exp, 0)) + strlen (XSTR (exp, 1)) + 2 > 256)
abort ();
strcpy (string, XSTR (exp, 0)); strcpy (string, XSTR (exp, 0));
strcat (string, "_"); strcat (string, "_");
@ -2029,12 +2026,13 @@ evaluate_eq_attr (rtx exp, rtx value, int insn_code, int insn_index)
newexp = attr_rtx (EQ, value, newexp = attr_rtx (EQ, value,
attr_rtx (SYMBOL_REF, attr_rtx (SYMBOL_REF,
DEF_ATTR_STRING (string))); DEF_ATTR_STRING (string)));
break;
} }
else if (GET_CODE (value) == COND)
{ case COND:
/* We construct an IOR of all the cases for which the requested attribute /* We construct an IOR of all the cases for which the
value is present. Since we start with FALSE, if it is not present, requested attribute value is present. Since we start with
FALSE will be returned. FALSE, if it is not present, FALSE will be returned.
Each case is the AND of the NOT's of the previous conditions with the Each case is the AND of the NOT's of the previous conditions with the
current condition; in the default case the current condition is TRUE. current condition; in the default case the current condition is TRUE.
@ -2080,9 +2078,11 @@ evaluate_eq_attr (rtx exp, rtx value, int insn_code, int insn_index)
insn_code, insn_index), insn_code, insn_index),
insn_code, insn_index); insn_code, insn_index);
newexp = insert_right_side (IOR, orexp, right, insn_code, insn_index); newexp = insert_right_side (IOR, orexp, right, insn_code, insn_index);
break;
default:
gcc_unreachable ();
} }
else
abort ();
/* If uses an address, must return original expression. But set the /* If uses an address, must return original expression. But set the
ATTR_IND_SIMPLIFIED_P bit so we don't try to simplify it again. */ ATTR_IND_SIMPLIFIED_P bit so we don't try to simplify it again. */
@ -2401,13 +2401,14 @@ attr_alt_subset_p (rtx s1, rtx s2)
return !(XINT (s2, 0) &~ XINT (s1, 0)); return !(XINT (s2, 0) &~ XINT (s1, 0));
default: default:
abort (); gcc_unreachable ();
} }
} }
/* Returns true if S1 is a subset of complement of S2. */ /* Returns true if S1 is a subset of complement of S2. */
static bool attr_alt_subset_of_compl_p (rtx s1, rtx s2) static bool
attr_alt_subset_of_compl_p (rtx s1, rtx s2)
{ {
switch ((XINT (s1, 1) << 1) | XINT (s2, 1)) switch ((XINT (s1, 1) << 1) | XINT (s2, 1))
{ {
@ -2424,7 +2425,7 @@ static bool attr_alt_subset_of_compl_p (rtx s1, rtx s2)
return false; return false;
default: default:
abort (); gcc_unreachable ();
} }
} }
@ -2450,7 +2451,7 @@ attr_alt_intersection (rtx s1, rtx s2)
XINT (result, 0) = XINT (s1, 0) | XINT (s2, 0); XINT (result, 0) = XINT (s1, 0) | XINT (s2, 0);
break; break;
default: default:
abort (); gcc_unreachable ();
} }
XINT (result, 1) = XINT (s1, 1) & XINT (s2, 1); XINT (result, 1) = XINT (s1, 1) & XINT (s2, 1);
@ -2479,7 +2480,7 @@ attr_alt_union (rtx s1, rtx s2)
XINT (result, 0) = XINT (s1, 0) & XINT (s2, 0); XINT (result, 0) = XINT (s1, 0) & XINT (s2, 0);
break; break;
default: default:
abort (); gcc_unreachable ();
} }
XINT (result, 1) = XINT (s1, 1) | XINT (s2, 1); XINT (result, 1) = XINT (s1, 1) | XINT (s2, 1);
@ -2898,8 +2899,7 @@ optimize_attrs (void)
} }
/* Sanity check on num_insn_ents. */ /* Sanity check on num_insn_ents. */
if (iv != ivbuf + num_insn_ents) gcc_assert (iv == ivbuf + num_insn_ents);
abort ();
/* Process one insn code at a time. */ /* Process one insn code at a time. */
for (i = -2; i < insn_code_number; i++) for (i = -2; i < insn_code_number; i++)
@ -3210,7 +3210,7 @@ gen_insn (rtx exp, int lineno)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
@ -3354,7 +3354,7 @@ write_test_expr (rtx exp, int flags)
printf (" >> "); printf (" >> ");
break; break;
default: default:
abort (); gcc_unreachable ();
} }
write_test_expr (XEXP (exp, 1), flags | comparison_operator); write_test_expr (XEXP (exp, 1), flags | comparison_operator);
@ -3388,7 +3388,7 @@ write_test_expr (rtx exp, int flags)
printf ("-"); printf ("-");
break; break;
default: default:
abort (); gcc_unreachable ();
} }
write_test_expr (XEXP (exp, 0), flags); write_test_expr (XEXP (exp, 0), flags);
@ -3454,8 +3454,7 @@ write_test_expr (rtx exp, int flags)
} }
attr = find_attr (&XSTR (exp, 0), 0); attr = find_attr (&XSTR (exp, 0), 0);
if (! attr) gcc_assert (attr);
abort ();
/* Now is the time to expand the value of a constant attribute. */ /* Now is the time to expand the value of a constant attribute. */
if (attr->is_const) if (attr->is_const)
@ -4062,7 +4061,7 @@ write_attr_value (struct attr_desc *attr, rtx value)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
@ -4126,8 +4125,7 @@ write_eligible_delay (const char *kind)
printf ("{\n"); printf ("{\n");
printf (" rtx insn;\n"); printf (" rtx insn;\n");
printf ("\n"); printf ("\n");
printf (" if (slot >= %d)\n", max_slots); printf (" gcc_assert (slot < %d)\n", max_slots);
printf (" abort ();\n");
printf ("\n"); printf ("\n");
/* Allow dbr_schedule to pass labels, etc. This can happen if try_split /* Allow dbr_schedule to pass labels, etc. This can happen if try_split
converts a compound instruction into a loop. */ converts a compound instruction into a loop. */
@ -4140,8 +4138,7 @@ write_eligible_delay (const char *kind)
if (num_delays > 1) if (num_delays > 1)
{ {
attr = find_attr (&delay_type_str, 0); attr = find_attr (&delay_type_str, 0);
if (! attr) gcc_assert (attr);
abort ();
common_av = find_most_used (attr); common_av = find_most_used (attr);
printf (" insn = delay_insn;\n"); printf (" insn = delay_insn;\n");
@ -4157,8 +4154,7 @@ write_eligible_delay (const char *kind)
printf (" }\n\n"); printf (" }\n\n");
/* Ensure matched. Otherwise, shouldn't have been called. */ /* Ensure matched. Otherwise, shouldn't have been called. */
printf (" if (slot < %d)\n", max_slots); printf (" gcc_assert (slot >= %d);\n\n", max_slots);
printf (" abort ();\n\n");
} }
/* If just one type of delay slot, write simple switch. */ /* If just one type of delay slot, write simple switch. */
@ -4169,8 +4165,7 @@ write_eligible_delay (const char *kind)
printf (" {\n"); printf (" {\n");
attr = find_attr (&delay_1_0_str, 0); attr = find_attr (&delay_1_0_str, 0);
if (! attr) gcc_assert (attr);
abort ();
common_av = find_most_used (attr); common_av = find_most_used (attr);
for (av = attr->first_value; av; av = av->next) for (av = attr->first_value; av; av = av->next)
@ -4200,8 +4195,7 @@ write_eligible_delay (const char *kind)
sprintf (str, "*%s_%d_%d", kind, delay->num, i / 3); sprintf (str, "*%s_%d_%d", kind, delay->num, i / 3);
pstr = str; pstr = str;
attr = find_attr (&pstr, 0); attr = find_attr (&pstr, 0);
if (! attr) gcc_assert (attr);
abort ();
common_av = find_most_used (attr); common_av = find_most_used (attr);
for (av = attr->first_value; av; av = av->next) for (av = attr->first_value; av; av = av->next)
@ -4213,7 +4207,7 @@ write_eligible_delay (const char *kind)
} }
printf (" default:\n"); printf (" default:\n");
printf (" abort ();\n"); printf (" gcc_unreachable ();\n");
printf (" }\n"); printf (" }\n");
} }
@ -4292,8 +4286,7 @@ make_internal_attr (const char *name, rtx value, int special)
struct attr_desc *attr; struct attr_desc *attr;
attr = find_attr (&name, 1); attr = find_attr (&name, 1);
if (attr->default_val) gcc_assert (!attr->default_val);
abort ();
attr->is_numeric = 1; attr->is_numeric = 1;
attr->is_const = 0; attr->is_const = 0;
@ -4332,8 +4325,7 @@ make_numeric_value (int n)
rtx exp; rtx exp;
char *p; char *p;
if (n < 0) gcc_assert (n >= 0);
abort ();
if (n < 20 && int_values[n]) if (n < 20 && int_values[n])
return int_values[n]; return int_values[n];

File diff suppressed because it is too large Load Diff

View File

@ -260,7 +260,7 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used)
case CONST_DOUBLE: case CONST_DOUBLE:
/* These shouldn't be written in MD files. Instead, the appropriate /* These shouldn't be written in MD files. Instead, the appropriate
routines in varasm.c should be called. */ routines in varasm.c should be called. */
abort (); gcc_unreachable ();
default: default:
break; break;
@ -277,13 +277,21 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used)
if (fmt[i] == '0') if (fmt[i] == '0')
break; break;
printf (",\n\t"); printf (",\n\t");
if (fmt[i] == 'e' || fmt[i] == 'u') switch (fmt[i])
{
case 'e': case 'u':
gen_exp (XEXP (x, i), subroutine_type, used); gen_exp (XEXP (x, i), subroutine_type, used);
else if (fmt[i] == 'i') break;
case 'i':
printf ("%u", XINT (x, i)); printf ("%u", XINT (x, i));
else if (fmt[i] == 's') break;
case 's':
printf ("\"%s\"", XSTR (x, i)); printf ("\"%s\"", XSTR (x, i));
else if (fmt[i] == 'E') break;
case 'E':
{ {
int j; int j;
printf ("gen_rtvec (%d", XVECLEN (x, i)); printf ("gen_rtvec (%d", XVECLEN (x, i));
@ -293,9 +301,12 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used)
gen_exp (XVECEXP (x, i, j), subroutine_type, used); gen_exp (XVECEXP (x, i, j), subroutine_type, used);
} }
printf (")"); printf (")");
break;
}
default:
gcc_unreachable ();
} }
else
abort ();
} }
printf (")"); printf (")");
} }
@ -707,7 +718,7 @@ output_add_clobbers (void)
} }
printf (" default:\n"); printf (" default:\n");
printf (" abort ();\n"); printf (" gcc_unreachable ();\n");
printf (" }\n"); printf (" }\n");
printf ("}\n"); printf ("}\n");
} }
@ -745,7 +756,7 @@ output_added_clobbers_hard_reg_p (void)
} }
printf (" default:\n"); printf (" default:\n");
printf (" abort ();\n"); printf (" gcc_unreachable ();\n");
printf (" }\n"); printf (" }\n");
printf ("}\n"); printf ("}\n");
} }

View File

@ -326,7 +326,7 @@ print_path (const char *path)
else if (ISDIGIT(path[i])) else if (ISDIGIT(path[i]))
printf ("XEXP ("); printf ("XEXP (");
else else
abort (); gcc_unreachable ();
} }
printf ("pat"); printf ("pat");
@ -338,7 +338,7 @@ print_path (const char *path)
else if (ISDIGIT(path[i])) else if (ISDIGIT(path[i]))
printf (", %d)", path[i] - '0'); printf (", %d)", path[i] - '0');
else else
abort (); gcc_unreachable ();
} }
} }
@ -478,7 +478,7 @@ from the machine description file `md'. */\n\n");
/* This should never be reached. Note that we would also reach this abort /* This should never be reached. Note that we would also reach this abort
if we tried to extract something whose INSN_CODE was a DEFINE_EXPAND or if we tried to extract something whose INSN_CODE was a DEFINE_EXPAND or
DEFINE_SPLIT, but that is correct. */ DEFINE_SPLIT, but that is correct. */
printf (" default:\n abort ();\n"); printf (" default:\n gcc_unreachable ();\n");
printf (" }\n}\n"); printf (" }\n}\n");

View File

@ -102,10 +102,8 @@ gen_macro (const char *name, int real, int expect)
{ {
int i; int i;
if (real > expect) gcc_assert (real <= expect);
abort (); gcc_assert (real);
if (real == 0)
abort ();
/* #define GEN_CALL(A, B, C, D) gen_call((A), (B)) */ /* #define GEN_CALL(A, B, C, D) gen_call((A), (B)) */
fputs ("#define GEN_", stdout); fputs ("#define GEN_", stdout);

View File

@ -84,7 +84,7 @@ type_from_format (int c)
case 'B': case 'B':
return "struct basic_block_def *"; /* basic block - typedef not available */ return "struct basic_block_def *"; /* basic block - typedef not available */
default: default:
abort (); gcc_unreachable ();
} }
} }
@ -120,7 +120,7 @@ accessor_from_format (int c)
return "XBBDEF"; return "XBBDEF";
default: default:
abort (); gcc_unreachable ();
} }
} }

View File

@ -24,7 +24,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tm.h" #include "tm.h"
#include "gengtype.h" #include "gengtype.h"
#include "gtyp-gen.h" #include "gtyp-gen.h"
#undef abort #include "errors.h"
/* Nonzero iff an error has occurred. */ /* Nonzero iff an error has occurred. */
static int hit_error = 0; static int hit_error = 0;
@ -1128,7 +1128,7 @@ get_file_basename (const char *f)
{ {
basename -= l2 + 1; basename -= l2 + 1;
if ((basename - f - 1) != srcdir_len) if ((basename - f - 1) != srcdir_len)
abort (); /* Match is wrong - should be preceded by $srcdir. */ fatal ("filename `%s' should be preceded by $srcdir", f);
break; break;
} }
} }
@ -1442,7 +1442,7 @@ output_mangled_typename (outf_p of, type_p t)
} }
break; break;
case TYPE_ARRAY: case TYPE_ARRAY:
abort (); gcc_unreachable ();
} }
} }
@ -1608,7 +1608,7 @@ walk_type (type_p t, struct walk_type_data *d)
if (maybe_undef_p if (maybe_undef_p
&& t->u.p->u.s.line.file == NULL) && t->u.p->u.s.line.file == NULL)
{ {
oprintf (d->of, "%*sif (%s) abort();\n", d->indent, "", d->val); oprintf (d->of, "%*sgcc_assert (!%s);\n", d->indent, "", d->val);
break; break;
} }
@ -1844,7 +1844,7 @@ walk_type (type_p t, struct walk_type_data *d)
d->used_length = false; d->used_length = false;
if (union_p && use_param_p && d->param == NULL) if (union_p && use_param_p && d->param == NULL)
oprintf (d->of, "%*sabort();\n", d->indent, ""); oprintf (d->of, "%*sgcc_unreachable ();\n", d->indent, "");
else else
walk_type (f->type, d); walk_type (f->type, d);
@ -1900,7 +1900,7 @@ walk_type (type_p t, struct walk_type_data *d)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
@ -1957,7 +1957,7 @@ write_types_process_field (type_p f, const struct walk_type_data *d)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
@ -2227,7 +2227,7 @@ write_types_local_process_field (type_p f, const struct walk_type_data *d)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }

View File

@ -364,7 +364,7 @@ complete_mode (struct mode_data *m)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
/* If not already specified, the mode alignment defaults to the largest /* If not already specified, the mode alignment defaults to the largest

View File

@ -281,7 +281,7 @@ gen_insn (rtx insn)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }

View File

@ -379,7 +379,7 @@ output_insn_data (void)
printf ("#endif\n"); printf ("#endif\n");
break; break;
default: default:
abort (); gcc_unreachable ();
} }
if (d->name && d->name[0] != '*') if (d->name && d->name[0] != '*')
@ -1076,8 +1076,7 @@ check_constraint_len (void)
for (p = ",#*+=&%!1234567890"; *p; p++) for (p = ",#*+=&%!1234567890"; *p; p++)
for (d = -9; d < 9; d++) for (d = -9; d < 9; d++)
if (constraint_len (p, d) != d) gcc_assert (constraint_len (p, d) == d);
abort ();
} }
static int static int
@ -1085,8 +1084,7 @@ constraint_len (const char *p, int genoutput_default_constraint_len)
{ {
/* Check that we still match defaults.h . First we do a generation-time /* Check that we still match defaults.h . First we do a generation-time
check that fails if the value is not the expected one... */ check that fails if the value is not the expected one... */
if (DEFAULT_CONSTRAINT_LEN (*p, p) != 1) gcc_assert (DEFAULT_CONSTRAINT_LEN (*p, p) == 1);
abort ();
/* And now a compile-time check that should give a diagnostic if the /* And now a compile-time check that should give a diagnostic if the
definition doesn't exactly match. */ definition doesn't exactly match. */
#define DEFAULT_CONSTRAINT_LEN(C,STR) 1 #define DEFAULT_CONSTRAINT_LEN(C,STR) 1

View File

@ -259,38 +259,47 @@ add_mode_tests (struct pred_data *p)
for (;;) for (;;)
{ {
rtx subexp = *pos; rtx subexp = *pos;
if (GET_CODE (subexp) == IOR)
{
if (NO_MODE_TEST (XEXP (subexp, 0))
&& NO_MODE_TEST (XEXP (subexp, 1)))
break;
else if (NO_MODE_TEST (XEXP (subexp, 0)))
pos = &XEXP (subexp, 0);
else if (NO_MODE_TEST (XEXP (subexp, 1)))
pos = &XEXP (subexp, 1);
else
abort ();
}
else if (GET_CODE (subexp) == IF_THEN_ELSE)
{
if (NO_MODE_TEST (XEXP (subexp, 0))
&& NO_MODE_TEST (XEXP (subexp, 1))
&& NO_MODE_TEST (XEXP (subexp, 2)))
break;
else if (NO_MODE_TEST (XEXP (subexp, 0))
&& NO_MODE_TEST (XEXP (subexp, 1)))
/* Must put it on the dependent clause, not the controlling
expression, or we change the meaning of the test. */
pos = &XEXP (subexp, 1);
else if (NO_MODE_TEST (XEXP (subexp, 2)))
pos = &XEXP (subexp, 2);
else
abort ();
}
else
break;
}
switch (GET_CODE (subexp))
{
case IOR:
{
int test0 = NO_MODE_TEST (XEXP (subexp, 0));
int test1 = NO_MODE_TEST (XEXP (subexp, 1));
gcc_assert (test0 || test1);
if (test0 && test1)
goto break_loop;
pos = test0 ? &XEXP (subexp, 0) : &XEXP (subexp, 1);
}
break;
case IF_THEN_ELSE:
{
int test0 = NO_MODE_TEST (XEXP (subexp, 0));
int test1 = NO_MODE_TEST (XEXP (subexp, 1));
int test2 = NO_MODE_TEST (XEXP (subexp, 2));
gcc_assert ((test0 && test1) || test2);
if (test0 && test1 && test2)
goto break_loop;
if (test0 && test1)
/* Must put it on the dependent clause, not the
controlling expression, or we change the meaning of
the test. */
pos = &XEXP (subexp, 1);
else
pos = &XEXP (subexp, 2);
}
break;
default:
goto break_loop;
}
}
break_loop:
XEXP (and_exp, 0) = *pos; XEXP (and_exp, 0) = *pos;
*pos = and_exp; *pos = and_exp;
} }

View File

@ -547,7 +547,7 @@ find_operand (rtx pattern, int n, rtx stop)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
@ -598,7 +598,7 @@ find_matching_operand (rtx pattern, int n)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
@ -851,7 +851,7 @@ validate_pattern (rtx pattern, rtx insn, rtx set, int set_code)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
} }
@ -1050,18 +1050,18 @@ add_to_sequence (rtx pattern, struct decision_head *last, const char *position,
{ {
if (fmt[i] == 'i') if (fmt[i] == 'i')
{ {
if (i == 0) gcc_assert (i < 2);
if (!i)
{ {
test = new_decision_test (DT_elt_zero_int, &place); test = new_decision_test (DT_elt_zero_int, &place);
test->u.intval = XINT (pattern, i); test->u.intval = XINT (pattern, i);
} }
else if (i == 1) else
{ {
test = new_decision_test (DT_elt_one_int, &place); test = new_decision_test (DT_elt_one_int, &place);
test->u.intval = XINT (pattern, i); test->u.intval = XINT (pattern, i);
} }
else
abort ();
} }
else if (fmt[i] == 'w') else if (fmt[i] == 'w')
{ {
@ -1071,16 +1071,14 @@ add_to_sequence (rtx pattern, struct decision_head *last, const char *position,
= ((int) XWINT (pattern, i) == XWINT (pattern, i)) = ((int) XWINT (pattern, i) == XWINT (pattern, i))
? DT_elt_zero_wide_safe : DT_elt_zero_wide; ? DT_elt_zero_wide_safe : DT_elt_zero_wide;
if (i != 0) gcc_assert (!i);
abort ();
test = new_decision_test (type, &place); test = new_decision_test (type, &place);
test->u.intval = XWINT (pattern, i); test->u.intval = XWINT (pattern, i);
} }
else if (fmt[i] == 'E') else if (fmt[i] == 'E')
{ {
if (i != 0) gcc_assert (!i);
abort ();
test = new_decision_test (DT_veclen, &place); test = new_decision_test (DT_veclen, &place);
test->u.veclen = XVECLEN (pattern, i); test->u.veclen = XVECLEN (pattern, i);
@ -1117,7 +1115,7 @@ add_to_sequence (rtx pattern, struct decision_head *last, const char *position,
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
@ -1139,8 +1137,7 @@ add_to_sequence (rtx pattern, struct decision_head *last, const char *position,
} }
/* If we didn't insert any tests or accept nodes, hork. */ /* If we didn't insert any tests or accept nodes, hork. */
if (this->tests == NULL) gcc_assert (this->tests);
abort ();
ret: ret:
free (subpos); free (subpos);
@ -1311,8 +1308,7 @@ maybe_both_true (struct decision *d1, struct decision *d2,
cmp = strcmp (d1->position, d2->position); cmp = strcmp (d1->position, d2->position);
if (cmp != 0) if (cmp != 0)
{ {
if (toplevel) gcc_assert (!toplevel);
abort ();
/* If the d2->position was lexically lower, swap. */ /* If the d2->position was lexically lower, swap. */
if (cmp > 0) if (cmp > 0)
@ -1390,7 +1386,7 @@ nodes_identical_1 (struct decision_test *d1, struct decision_test *d2)
return 1; return 1;
default: default:
abort (); gcc_unreachable ();
} }
} }
@ -1492,8 +1488,7 @@ merge_trees (struct decision_head *oldh, struct decision_head *addh)
} }
/* Trying to merge bits at different positions isn't possible. */ /* Trying to merge bits at different positions isn't possible. */
if (strcmp (oldh->first->position, addh->first->position)) gcc_assert (!strcmp (oldh->first->position, addh->first->position));
abort ();
for (add = addh->first; add ; add = next) for (add = addh->first; add ; add = next)
{ {
@ -1989,7 +1984,7 @@ write_switch (struct decision *start, int depth)
printf ("(int) XWINT (x%d, 0)", depth); printf ("(int) XWINT (x%d, 0)", depth);
break; break;
default: default:
abort (); gcc_unreachable ();
} }
printf (")\n%s {\n", indent); printf (")\n%s {\n", indent);
@ -2022,7 +2017,7 @@ write_switch (struct decision *start, int depth)
print_host_wide_int (p->tests->u.intval); print_host_wide_int (p->tests->u.intval);
break; break;
default: default:
abort (); gcc_unreachable ();
} }
printf (":\n%s goto L%d;\n", indent, p->success.first->number); printf (":\n%s goto L%d;\n", indent, p->success.first->number);
p->success.first->need_label = 1; p->success.first->need_label = 1;
@ -2102,21 +2097,13 @@ write_cond (struct decision_test *p, int depth,
break; break;
case DT_accept_insn: case DT_accept_insn:
switch (subroutine_type) gcc_assert (subroutine_type == RECOG);
{ gcc_assert (p->u.insn.num_clobbers_to_add);
case RECOG:
if (p->u.insn.num_clobbers_to_add == 0)
abort ();
printf ("pnum_clobbers != NULL"); printf ("pnum_clobbers != NULL");
break; break;
default: default:
abort (); gcc_unreachable ();
}
break;
default:
abort ();
} }
} }
@ -2151,14 +2138,12 @@ write_action (struct decision *p, struct decision_test *test,
if (test->next) if (test->next)
{ {
test = test->next; test = test->next;
if (test->type != DT_accept_insn) gcc_assert (test->type == DT_accept_insn);
abort ();
} }
} }
/* Sanity check that we're now at the end of the list of tests. */ /* Sanity check that we're now at the end of the list of tests. */
if (test->next) gcc_assert (!test->next);
abort ();
if (test->type == DT_accept_insn) if (test->type == DT_accept_insn)
{ {
@ -2196,7 +2181,7 @@ write_action (struct decision *p, struct decision_test *test,
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
else else
@ -2231,7 +2216,7 @@ is_unconditional (struct decision_test *t, enum routine_type subroutine_type)
case PEEPHOLE2: case PEEPHOLE2:
return -1; return -1;
default: default:
abort (); gcc_unreachable ();
} }
} }
@ -2527,8 +2512,7 @@ make_insn_sequence (rtx insn, enum routine_type type)
char c_test_pos[2]; char c_test_pos[2];
/* We should never see an insn whose C test is false at compile time. */ /* We should never see an insn whose C test is false at compile time. */
if (truth == 0) gcc_assert (truth);
abort ();
record_insn_name (next_insn_code, (type == RECOG ? XSTR (insn, 0) : NULL)); record_insn_name (next_insn_code, (type == RECOG ? XSTR (insn, 0) : NULL));
@ -2874,7 +2858,7 @@ debug_decision_2 (struct decision_test *test)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }

View File

@ -392,7 +392,7 @@ is_predicable (struct queue_elem *elem)
return 0; return 0;
default: default:
abort (); gcc_unreachable ();
} }
} }
@ -559,7 +559,7 @@ collect_insn_data (rtx pattern, int *palt, int *pmax)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
} }
@ -645,7 +645,7 @@ alter_predicate_for_insn (rtx pattern, int alt, int max_op, int lineno)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
@ -1119,8 +1119,7 @@ maybe_eval_c_test (const char *expr)
dummy.expr = expr; dummy.expr = expr;
test = (const struct c_test *)htab_find (condition_table, &dummy); test = (const struct c_test *)htab_find (condition_table, &dummy);
if (!test) gcc_assert (test);
abort ();
return test->value; return test->value;
} }