This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: shrink insn-attrtab.o by 4kB
Please try this patch. It is not clear to me why the automata
functions are referenced at all when a target doesn't define a
DFA scheduler, and I'm not getting the -Werror thing for some
reason with my cross compiler, but the patch does squelch all
the warnings that I see for insn-attrtab.c in an i686-linux ->
powerpc-elf cross configuration.
zw
* genautomata.c (output_internal_insn_latency_func,
output_print_reservation_func): Short circuit when there is no
automaton to generate code for.
===================================================================
Index: genautomata.c
--- genautomata.c 21 Jan 2003 21:10:40 -0000 1.36
+++ genautomata.c 21 Jan 2003 22:15:05 -0000
@@ -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,10 +9022,19 @@ 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);