defaults.h (SUPPORTS_INIT_PRIORITY): New macro to indicate the linker supports the...
authorJeffrey Oldham <oldham@codesourcery.com>
Mon, 15 Jan 2001 03:33:56 +0000 (03:33 +0000)
committerJeffrey D. Oldham <oldham@gcc.gnu.org>
Mon, 15 Jan 2001 03:33:56 +0000 (03:33 +0000)
gcc/ChangeLog:
2001-01-14  Jeffrey Oldham  <oldham@codesourcery.com>

* defaults.h (SUPPORTS_INIT_PRIORITY): New macro to indicate the
linker supports the init_priority C++ attribute.
* tm.texi (SUPPORTS_INIT_PRIORITY): Documentation for new macro.
* config/mips/iris6.h (SUPPORTS_INIT_PRIORITY): Indicate Irix
linker does not support init_priority C++ attribute.

gcc/cp/ChangeLog:
2001-01-14  Jeffrey Oldham  <oldham@codesourcery.com>

* tree.c: Add defaults.h
(cp_valid_lang_attribute): Incorporate SUPPORTS_INIT_PRIORITY.
* Make-lang.in (cp/tree.o): Add defaults.h.

From-SVN: r39023

gcc/ChangeLog
gcc/config/mips/iris6.h
gcc/cp/ChangeLog
gcc/cp/Make-lang.in
gcc/cp/tree.c
gcc/defaults.h
gcc/tm.texi

index 2d2a7a5101c5b7146d9cd264bbb74e45dcc37021..12d67febc80485f46f8ac4c0ab2e9411978f762d 100644 (file)
@@ -1,3 +1,11 @@
+2001-01-14  Jeffrey Oldham  <oldham@codesourcery.com>
+
+       * defaults.h (SUPPORTS_INIT_PRIORITY): New macro to indicate the
+       linker supports the init_priority C++ attribute.
+       * tm.texi (SUPPORTS_INIT_PRIORITY): Documentation for new macro.
+       * config/mips/iris6.h (SUPPORTS_INIT_PRIORITY): Indicate Irix
+       linker does not support init_priority C++ attribute.
+
 Sun Jan 14 22:31:30 2001  J"orn Rennecke <amylaar@redhat.com>
 
        * Makefile.in (libgcc1-test.o): Depends on stmp-int-hdrs.
index 3c888531238c8f7248412e3fc6b9156be3b60f93..b7a6f8f64e37a2feb52e8fe8242bd1510c3a8c7e 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions of target machine for GNU compiler.  Iris version 6.
-   Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -205,6 +205,10 @@ Boston, MA 02111-1307, USA.  */
 
 #define ASM_WEAKEN_LABEL(FILE,NAME) ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,0)
 
+/* Irix assembler does not support the init_priority C++ attribute.  */
+#undef SUPPORTS_INIT_PRIORITY
+#define SUPPORTS_INIT_PRIORITY 0
+
 #define POPSECTION_ASM_OP      "\t.popsection"
 
 #define DEBUG_INFO_SECTION     ".debug_info,0x7000001e,0,0,1"
index b5a9194e621811f5b4d1143f7214bb34ad22f640..21ca094f989fc41be862600acad01f7f6567af4f 100644 (file)
@@ -1,3 +1,9 @@
+2001-01-14  Jeffrey Oldham  <oldham@codesourcery.com>
+
+       * tree.c: Add defaults.h
+       (cp_valid_lang_attribute): Incorporate SUPPORTS_INIT_PRIORITY.
+       * Make-lang.in (cp/tree.o): Add defaults.h.
+
 2001-01-13  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * Make-lang.in (CXX_C_OBJS): Add c-format.o.
index 766e695ab82d5b6e7f7214d5fcd251d6b140dd87..b6bbd37516af667ceeb486f33561010c158c24f6 100644 (file)
@@ -274,7 +274,7 @@ cp/method.o: cp/method.c $(CXX_TREE_H) toplev.h $(GGC_H) $(RTL_H) $(EXPR_H)
 cp/cvt.o: cp/cvt.c $(CXX_TREE_H) cp/decl.h flags.h toplev.h convert.h
 cp/search.o: cp/search.c $(CXX_TREE_H) stack.h flags.h toplev.h $(RTL_H)
 cp/tree.o: cp/tree.c $(CXX_TREE_H) flags.h toplev.h $(GGC_H) $(RTL_H) \
-  insn-config.h integrate.h
+  insn-config.h integrate.h defaults.h
 cp/ptree.o: cp/ptree.c $(CXX_TREE_H) system.h
 cp/rtti.o: cp/rtti.c $(CXX_TREE_H) flags.h toplev.h defaults.h
 cp/except.o: cp/except.c $(CXX_TREE_H) flags.h $(RTL_H) except.h toplev.h \
index 4f55c703240dcc7c4596ad01232708fbceb71748..88f07be94dcc3a17bbcbf11960432dff4b22260a 100644 (file)
@@ -1,6 +1,6 @@
 /* Language-dependent node constructors for parse phase of GNU compiler.
    Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000 Free Software Foundation, Inc.
+   1999, 2000, 2001 Free Software Foundation, Inc.
    Hacked by Michael Tiemann (tiemann@cygnus.com)
 
 This file is part of GNU CC.
@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA.  */
 #include "ggc.h"
 #include "insn-config.h"
 #include "integrate.h"
+#include "defaults.h"
 
 static tree bot_manip PARAMS ((tree *, int *, void *));
 static tree bot_replace PARAMS ((tree *, int *, void *));
@@ -2312,8 +2313,16 @@ cp_valid_lang_attribute (attr_name, attr_args, decl, type)
            ("requested init_priority is reserved for internal use");
        }
 
-      DECL_INIT_PRIORITY (decl) = pri;
-      return 1;
+      if (SUPPORTS_INIT_PRIORITY)
+       {
+         DECL_INIT_PRIORITY (decl) = pri;
+         return 1;
+       }
+      else
+       {
+         error ("init_priority attribute is not supported on this platform");
+         return 0;
+       }
     }
 
   return 0;
index 2f2aee9346f66d2bb06afd998b09cc70af27ec14..2aa5218d464180ef1f2b39c31779ea9fd8f9baa3 100644 (file)
@@ -1,7 +1,7 @@
 /* Definitions of various defaults for how to do assembler output
    (most of which are designed to be appropriate for GAS or for
    some BSD assembler).
-   Copyright (C) 1992, 1996, 1997, 1998, 1999, 2000
+   Copyright (C) 1992, 1996, 1997, 1998, 1999, 2000, 2001
    Free Software Foundation, Inc.
    Contributed by Ron Guilmette (rfg@monkeys.com)
 
@@ -167,6 +167,12 @@ do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (0)
 # endif
 #endif
 
+/* If the target supports init_priority C++ attribute, give
+   SUPPORTS_INIT_PRIORITY a nonzero value.  */
+#ifndef SUPPORTS_INIT_PRIORITY
+#define SUPPORTS_INIT_PRIORITY 1
+#endif /* SUPPORTS_INIT_PRIORITY */
+
 /* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
    the rest of the DWARF 2 frame unwind support is also provided.  */
 #if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX)
index 0cba90968950db9fff0036abb8127b86f87b2e5d..16afc46b00853fc9eb958ad256fe7cfdd2cf4bd5 100644 (file)
@@ -6387,6 +6387,13 @@ If defined, @code{main} will call @code{__main} despite the presence of
 where the init section is not actually run automatically, but is still
 useful for collecting the lists of constructors and destructors.
 
+@item SUPPORTS_INIT_PRIORITY
+@findex SUPPORTS_INIT_PRIORITY
+If nonzero, the C++ @code{init_priority} attribute is supported and the
+compiler should emit instructions to control the order of initialization
+of objects.  If zero, the compiler will issue an error message upon
+encountering an @code{init_priority} attribute.
+
 @item ASM_OUTPUT_CONSTRUCTOR (@var{stream}, @var{name})
 @findex ASM_OUTPUT_CONSTRUCTOR
 Define this macro as a C statement to output on the stream @var{stream}