diff options
author | Zack Weinberg <zackw@panix.com> | 2006-01-23 15:16:00 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2006-01-23 15:16:00 +0000 |
commit | 63e2552f6ccb9508ad61a3d7852a3ed6c782047c (patch) | |
tree | a7e6d4019c5a69944e5aa5a48c2abedf1ad6a515 | |
parent | 8c94f366afaac439750606fe3cb7b52207afa6e4 (diff) | |
download | gcc-63e2552f6ccb9508ad61a3d7852a3ed6c782047c.zip gcc-63e2552f6ccb9508ad61a3d7852a3ed6c782047c.tar.gz gcc-63e2552f6ccb9508ad61a3d7852a3ed6c782047c.tar.bz2 |
r110128@banpei: zack | 2006-01-22 14:50:42 -0800
r110128@banpei: zack | 2006-01-22 14:50:42 -0800
* genautomata.c (output_reserved_units_table): Emit nothing if
description->query_units_num is zero. Remove extra blank line.
(output_cpu_unit_reservation_p): Short circuit
if description->query_units_num is zero.
From-SVN: r110124
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/genautomata.c | 33 |
2 files changed, 25 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 12b58aa..d453d59 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2006-01-22 Zack Weinberg <zackw@panix.com> + * genautomata.c (output_reserved_units_table): Emit nothing if + description->query_units_num is zero. Remove extra blank line. + (output_cpu_unit_reservation_p): Short circuit + if description->query_units_num is zero. + +2006-01-22 Zack Weinberg <zackw@panix.com> + * genattrtab.c: Don't include genattrtab.h. Define ATTR_NONE and ATTR_SPECIAL (from genattrtab.h). Don't define num_dfa_decls nor any of the random handful of variables that used to be necessary diff --git a/gcc/genautomata.c b/gcc/genautomata.c index 75cb8c7..14165d6 100644 --- a/gcc/genautomata.c +++ b/gcc/genautomata.c @@ -7533,6 +7533,9 @@ output_reserved_units_table (automaton_t automaton) size_t n; int i; + if (description->query_units_num == 0) + return; + /* Create vect of pointers to states. */ output_states_vect = 0; pass_states (automaton, add_states_vect_el); @@ -7568,8 +7571,7 @@ output_reserved_units_table (automaton_t automaton) output_reserved_units_table_name (output_file, automaton); fprintf (output_file, "[] = {\n"); output_vect (reserved_units_table); - fprintf (output_file, "};\n"); - fprintf (output_file, "\n#endif /* #if %s */\n\n", + fprintf (output_file, "};\n#endif /* #if %s */\n\n", CPU_UNITS_QUERY_MACRO_NAME); VEC_free (state_t,heap, output_states_vect); @@ -8316,19 +8318,20 @@ output_cpu_unit_reservation_p (void) fprintf (output_file, "{\n gcc_assert (%s >= 0 && %s < %d);\n", CPU_CODE_PARAMETER_NAME, CPU_CODE_PARAMETER_NAME, description->query_units_num); - for (automaton = description->first_automaton; - automaton != NULL; - automaton = automaton->next_automaton) - { - fprintf (output_file, " if (("); - output_reserved_units_table_name (output_file, automaton); - fprintf (output_file, " [((struct %s *) %s)->", CHIP_NAME, STATE_NAME); - output_chip_member_name (output_file, automaton); - fprintf (output_file, " * %d + %s / 8] >> (%s %% 8)) & 1)\n", - (description->query_units_num + 7) / 8, - CPU_CODE_PARAMETER_NAME, CPU_CODE_PARAMETER_NAME); - fprintf (output_file, " return 1;\n"); - } + if (description->query_units_num > 0) + for (automaton = description->first_automaton; + automaton != NULL; + automaton = automaton->next_automaton) + { + fprintf (output_file, " if (("); + output_reserved_units_table_name (output_file, automaton); + fprintf (output_file, " [((struct %s *) %s)->", CHIP_NAME, STATE_NAME); + output_chip_member_name (output_file, automaton); + fprintf (output_file, " * %d + %s / 8] >> (%s %% 8)) & 1)\n", + (description->query_units_num + 7) / 8, + CPU_CODE_PARAMETER_NAME, CPU_CODE_PARAMETER_NAME); + fprintf (output_file, " return 1;\n"); + } fprintf (output_file, " return 0;\n}\n\n"); } |