public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RFA: Fix rtl-optimization/44752
@ 2010-07-12  6:54 Joern Rennecke
  2010-07-12 15:48 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Joern Rennecke @ 2010-07-12  6:54 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1338 bytes --]

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:
alpha-linux-gnu
hppa-linux-gnu
ia64-elf
m68k-elf
mips-elf
ppc-elf
s390-linux-gnu
sparc-elf

, however, the nine targets previously affected by PR44752 now succeed
in building insn-automata.o, and only fail later for assorted other,
unrelated reasons.

[-- Attachment #2: 44752-fix --]
[-- Type: text/plain, Size: 870 bytes --]

2010-07-12  Joern Rennecke  <joern.rennecke@embecosm.com>

	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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-12 15:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-12  6:54 RFA: Fix rtl-optimization/44752 Joern Rennecke
2010-07-12 15:48 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).