diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-09 13:22:38 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-09 13:22:38 +0000 |
commit | e0a4c0c284f901dd69a6e77aeb35c446bbb7bf19 (patch) | |
tree | 6fd0a5929e9f5230882fb5d3500103a7daee956f /gcc/genpreds.c | |
parent | 83c8a97789c308913dac832723c3596d408cb6eb (diff) | |
download | gcc-e0a4c0c284f901dd69a6e77aeb35c446bbb7bf19.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87236 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genpreds.c')
-rw-r--r-- | gcc/genpreds.c | 67 |
1 files changed, 38 insertions, 29 deletions
diff --git a/gcc/genpreds.c b/gcc/genpreds.c index cdfc8f54d36..b090ba4e1d0 100644 --- a/gcc/genpreds.c +++ b/gcc/genpreds.c @@ -259,38 +259,47 @@ add_mode_tests (struct pred_data *p) for (;;) { 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) + + switch (GET_CODE (subexp)) { - 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 (); + 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; } - else - break; } - + break_loop: XEXP (and_exp, 0) = *pos; *pos = and_exp; } |