public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR bootstrap/18058, building with Sun's CC
@ 2004-10-19 18:41 Andrew Pinski
  2004-10-23 23:52 ` Andrew Pinski
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Pinski @ 2004-10-19 18:41 UTC (permalink / raw)
  To: GCC Patches

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

The problem here is that we include some header files in 
insn-conditions.c
which include static inline functions and these functions reference 
global
variables and functions were are not included in the build programs.  
This
patch fixes this problem by adding a "#ifndef GENERATOR_FILE" around the
headers which include the problem right now.

OK? Bootstrapped and tested on powerpc-darwin with
STAGE1_CFLAGS='-g -fkeep-inline-functions' and also
Eric Botcazou tested it with Sun's CC.


ChangeLog:
	* genconditions.c (write_header): Wrap headers which are not able
	to use in generator programs with "#ifndef GENERATOR_FILE".

Patch:

[-- Attachment #2: temp.diff.txt --]
[-- Type: text/plain, Size: 1057 bytes --]

Index: genconditions.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/genconditions.c,v
retrieving revision 1.13
diff -u -p -r1.13 genconditions.c
--- genconditions.c	3 Aug 2004 23:30:44 -0000	1.13
+++ genconditions.c	19 Oct 2004 18:07:37 -0000
@@ -98,22 +98,23 @@ write_header (void)
 #define MAX_DUP_OPERANDS 10\n\
 #define MAX_INSNS_PER_SPLIT 5\n");
 
-  puts ("\
+  puts ("#ifndef GENERATOR_FILE\n\
 #include \"regs.h\"\n\
-#include \"recog.h\"\n\
 #include \"real.h\"\n\
 #include \"output.h\"\n\
-#include \"flags.h\"\n\
-#include \"hard-reg-set.h\"\n\
 #include \"resource.h\"\n\
 #include \"toplev.h\"\n\
-#include \"reload.h\"\n\
-#include \"gensupport.h\"\n");
+#include \"reload.h\"\n");
 
   if (saw_eh_return)
     puts ("#define HAVE_eh_return 1");
   puts ("#include \"except.h\"\n");
 
+  puts ("#endif\n\
+#include \"flags.h\"\n\
+#include \"recog.h\"\n\
+#include \"hard-reg-set.h\"\n\
+#include \"gensupport.h\"\n");
   puts ("\
 /* Dummy external declarations.  */\n\
 extern rtx insn;\n\

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

* Re: [PATCH] Fix PR bootstrap/18058, building with Sun's CC
  2004-10-19 18:41 [PATCH] Fix PR bootstrap/18058, building with Sun's CC Andrew Pinski
@ 2004-10-23 23:52 ` Andrew Pinski
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Pinski @ 2004-10-23 23:52 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: GCC Patches

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


On Oct 19, 2004, at 2:23 PM, Andrew Pinski wrote:

> The problem here is that we include some header files in 
> insn-conditions.c
> which include static inline functions and these functions reference 
> global
> variables and functions were are not included in the build programs.  
> This
> patch fixes this problem by adding a "#ifndef GENERATOR_FILE" around 
> the
> headers which include the problem right now.
>
> OK? Bootstrapped and tested on powerpc-darwin with
> STAGE1_CFLAGS='-g -fkeep-inline-functions' and also
> Eric Botcazou tested it with Sun's CC.

Well this does not work on a cross to m68k. Darn.

This works everywhere.  We need to say the static functions in
bitmap.h are not for GENERATOR_FILE programs.

OK? Bootstrapped and tested on powerpc-darwin and crossed to m68k
also.

Thanks,
Andrew Pinski

ChangeLog:
	* bitmap.h: Ifndef GENERATOR_FILE around the static inline
	functions.


[-- Attachment #2: fixboot.patch.txt --]
[-- Type: text/plain, Size: 825 bytes --]

Index: bitmap.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/bitmap.h,v
retrieving revision 1.38
diff -u -p -r1.38 bitmap.h
--- bitmap.h	15 Oct 2004 14:47:05 -0000	1.38
+++ bitmap.h	23 Oct 2004 20:14:06 -0000
@@ -184,6 +184,7 @@ typedef struct
   BITMAP_WORD actual;
 } bitmap_iterator;
 
+#ifndef GENERATOR_FILE
 /* Moves the iterator BI to the first set bit on or after the current
    position in bitmap and returns the bit if available.  The bit is
    found in ACTUAL field only.  */
@@ -574,6 +575,8 @@ bmp_iter_and_next (bitmap_iterator *bi)
   return bmp_iter_and_next_1 (bi);
 }
 
+#endif
+
 /* Loop over all bits in BMP1 and BMP2, starting with MIN, setting
    BITNUM to the bit number for all bits that are set in both bitmaps.
    ITER is a bitmap iterator.  */

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

end of thread, other threads:[~2004-10-23 20:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-19 18:41 [PATCH] Fix PR bootstrap/18058, building with Sun's CC Andrew Pinski
2004-10-23 23:52 ` Andrew Pinski

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).