This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Re: Patch broke bootstrap on i386.


Nathanael Nerode wrote:
> 
> Bootstrap is failing in stage 2 building host-default.o on
> i686-pc-linux-gnu with this error:
> 
> In file included from ../../gcc-main/gcc/host-default.c:26:
> ../../gcc-main/gcc/hooks.h:26: warning: ISO C forbids forward references
> to `enum' types
> 
> Line 26 is:
> enum reg_class hook_reg_class_void_no_regs (void);
> 
> I'm pretty sure it's your patch:
> 
> 2003-06-18  Stephen Clarke <stephen.clarke@superh.com>
>             J"orn Rennecke <joern.rennecke@superh.com>
> 
>         * bt-load.c: New file.
>         * Makefile.in (OBJS): Include bt-load.o
>         (bt-load.o): Add dependencies.
>         * flags.h (flag_branch_target_load_optimize): Declare.
>         (flag_branch_target_load_optimize2): Likewise.
>         * hooks.c (hook_reg_class_void_no_regs): New function.
>         (hook_bool_bool_false): Likewise.
>         * hooks.h (hook_reg_class_void_no_regs, hook_bool_bool_false): Declare.
>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> <snip>
> 
> Hope you can fix this soon. :-P

Sorry, I forgot to re-do native testing after the update.

To use enum reg_class - even in a prototype - you have to include tm.h
now.
hooks.h already had some other implicit dependencies, but these are on
system.h (for bool) and coretypes.h (for tree), so thee are not too
onerous.  What was already dodgy was the unprotected use of FILE (rtl.h
guards this with #ifdef BUFSIZ), but as this doesn't appear to cause
acute brokenness right now, we can leave that for later.

Adding a hard dependency of hooks.h on tm.h doesn't appear to be a good
idea, with all what it would imply on the makefile rules.  The only
file that needs the hook_reg_class_void_no_regs prototype (hooks.c) already
includes hooks.h after tm.h, so all we need to do is guard the definition
with an #ifdef REG_CLASS_CONTENTS .  (It is a required macro, and it is
indeed defined by all current supported ports (pa.h doesn't have it, but
there is one definition each in	pa32-regs.h and pa64-regs.h ).

I have applied the attached patch as obvious.
	
-- 
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658
2003-06-19  J"orn Rennecke <joern.rennecke@superh.com>

	* hooks.h (hook_reg_class_void_no_regs): Only declare if tm.h
	has been included.

Index: hooks.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/hooks.h,v
retrieving revision 1.16
diff -p -r1.16 hooks.h
*** hooks.h	18 Jun 2003 19:43:49 -0000	1.16
--- hooks.h	19 Jun 2003 10:35:42 -0000
*************** Foundation, 59 Temple Place - Suite 330,
*** 23,29 ****
--- 23,37 ----
  #define GCC_HOOKS_H
  
  bool hook_bool_void_false PARAMS ((void));
+ 
+ /* Check if tm.h has been included, since ISO C does not allow forward
+    definitions for enums, and making hooks.h dependent on tm.h would create
+    unnecessary dependencies where no hook declaration involving
+    enum_reg_class is needed.  */
+ #ifdef REG_CLASS_CONTENTS
  enum reg_class hook_reg_class_void_no_regs (void);
+ #endif
+ 
  bool hook_bool_bool_false (bool);
  bool hook_bool_tree_false PARAMS ((tree));
  bool hook_bool_tree_hwi_hwi_tree_false

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