diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/genautomata.c | 20 |
2 files changed, 24 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 171f03d..923bd7b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-01-21 Zack Weinberg <zack@codesourcery.com> + + * genautomata.c (output_internal_insn_latency_func, + output_print_reservation_func): Short circuit when there is no + automaton to generate code for. + 2003-01-21 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * Makefile.in (ssa-ccp.o): Depend on coretypes.h $(TM_H). diff --git a/gcc/genautomata.c b/gcc/genautomata.c index 3fe4553..bb1a9d9 100644 --- a/gcc/genautomata.c +++ b/gcc/genautomata.c @@ -8920,12 +8920,19 @@ output_internal_insn_latency_func () INTERNAL_INSN_LATENCY_FUNC_NAME, INTERNAL_INSN_CODE_NAME, INTERNAL_INSN2_CODE_NAME, INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME); - fprintf (output_file, "\n\tint %s;\n\tint %s;\n", + fprintf (output_file, + "\n\tint %s ATTRIBUTE_UNUSED;\n\tint %s ATTRIBUTE_UNUSED;\n", INTERNAL_INSN_CODE_NAME, INTERNAL_INSN2_CODE_NAME); fprintf (output_file, "\trtx %s ATTRIBUTE_UNUSED;\n\trtx %s ATTRIBUTE_UNUSED;\n{\n", INSN_PARAMETER_NAME, INSN2_PARAMETER_NAME); + if (DECL_INSN_RESERV (advance_cycle_insn_decl)->insn_num == 0) + { + fputs (" return 0;\n}\n\n", output_file); + return; + } + fprintf (output_file, " static const %s default_latencies[] =\n {", tabletype); @@ -9015,11 +9022,20 @@ output_print_reservation_func () decl_t decl; int i, j; - fprintf (output_file, "void\n%s (%s, %s)\n\tFILE *%s;\n\trtx %s;\n{\n", + fprintf (output_file, + "void\n%s (%s, %s)\n\tFILE *%s;\n\trtx %s ATTRIBUTE_UNUSED;\n{\n", PRINT_RESERVATION_FUNC_NAME, FILE_PARAMETER_NAME, INSN_PARAMETER_NAME, FILE_PARAMETER_NAME, INSN_PARAMETER_NAME); + if (DECL_INSN_RESERV (advance_cycle_insn_decl)->insn_num == 0) + { + fprintf (output_file, " fputs (\"%s\", %s);\n}\n\n", + NOTHING_NAME, FILE_PARAMETER_NAME); + return; + } + + fputs (" static const char *const reservation_names[] =\n {", output_file); |