This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: Fix rtl-optimization/44752

Instead of inventing some random typedef or symbol, which could cause name
clashes, or using an explicit forward declration of  an existing struct,
which could bitrot when this is ever changed to a union or something else,
I include two common gcc header files that are also used in the other
code path; system.h, which at least declares fancy_abort, and before that
config.h, so that we get consistent declarations when all translation units
are considered.

Tested by building all-gcc for i686-pc-linux-gnu X {alpha-linux-gnu,arc-elf,arm-eabi,avr-elf,bfin-elf,cris-elf,crx-elf,fr30-elf,frv-elf,h8300-elf,ia64-elf,iq2000-elf,lm32-elf,m32c-elf,m32r-elf,m68hc11-elf,m68k-elf,mcore-elf,mep-elf,mips-elf,mmix-knuth-mmixware,mn10300-elf,moxie-elf,hppa-linux-gnu,,pdp11-elf,picochip-elf,ppc-elf,rx-elf,s390-linux-gnu,score-elf,sh-elf,sparc-elf,spu-elf,xstormy16-elf,v850-elf,vax-linux-gnu,xtensa-elf}

with the configure option  --enable-werror-always and using
gcc version 4.6.0 20100630 (experimental) (GCC) .

We still have the same list of targets that pass:

, however, the nine targets previously affected by PR44752 now succeed
in building insn-automata.o, and only fail later for assorted other,
unrelated reasons.
2010-07-12  Joern Rennecke  <>

	PR rtl-optimization/44752
	* genautomata.c (main): Don't emit an empty file even if there
	is no automaton.

Index: genautomata.c
--- genautomata.c	(revision 162035)
+++ genautomata.c	(working copy)
@@ -9568,6 +9568,14 @@ main (int argc, char **argv)
 	  write_automata ();
+  else
+    puts ("/* Generated automatically by the program `genautomata'\n"
+	  "   from the machine description file `md'.  */\n\n"
+	  "/* There is no automaton, but ISO C forbids empty\n"
+	  "   translation units, so include a header file with some\n"
+	  "   declarations, and the its pre-requisite header file.  */\n"
+	  "#include \"config.h\"\n"
+	  "#include \"system.h\"\n");
   fflush (stdout);
   return (ferror (stdout) != 0 || have_error

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]