OSDN Git Service

* config/alpha/vms.h (INCLUDE_DEFAULTS): Add /gnu/lib/gcc-lib/include.
[pf3gnuchains/gcc-fork.git] / gcc / ch / grant.c
index ddd8f93..48973e0 100644 (file)
@@ -1,6 +1,6 @@
 /* Implement grant-file output & seize-file input for CHILL.
-   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998,
-   1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+   Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA.  */
 #include "tasking.h"
 #include "toplev.h"
 #include "output.h"
+#include "target.h"
 
 #define APPEND(X,Y) X = append (X, Y)
 #define PREPEND(X,Y) X = prepend (X, Y);
@@ -1850,11 +1851,7 @@ decode_constant (init)
       return result;
 
     case REAL_CST:
-#ifndef REAL_IS_NOT_DOUBLE
-      sprintf (wrk, "%.20g", TREE_REAL_CST (val));
-#else
       REAL_VALUE_TO_DECIMAL (TREE_REAL_CST (val), "%.20g", wrk);
-#endif
       APPEND (result, wrk);
       return result;
 
@@ -2544,9 +2541,7 @@ globalize_decl (decl)
   if (!TREE_PUBLIC (decl) && DECL_NAME (decl) &&
       (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL))
     {
-      extern   FILE    *asm_out_file;
-      extern   char    *first_global_object_name;
-      const char       *name = XSTR (XEXP (DECL_RTL (decl), 0), 0);
+      const char *name = XSTR (XEXP (DECL_RTL (decl), 0), 0);
        
       if (!first_global_object_name)
        first_global_object_name = name + (name[0] == '*');
@@ -2650,7 +2645,7 @@ write_grant_file ()
 
   fb = fopen (grant_file_name, "w");
   if (fb == NULL)
-      pfatal_with_name (grant_file_name);
+    fatal_io_error ("can't open %s", grant_file_name);
     
   /* write file. Due to problems with record sizes on VAX/VMS
      write string to '\n' */
@@ -2672,9 +2667,10 @@ write_grant_file ()
   if (write (fileno (fb), gstring->str, gstring->len) < 0)
     {
       int save_errno = errno;
+
       unlink (grant_file_name);
       errno = save_errno;
-      pfatal_with_name (grant_file_name);
+      fatal_io_error ("can't write to %s", grant_file_name);
     }
 #endif
   fclose (fb);
@@ -2686,7 +2682,8 @@ write_grant_file ()
 void
 set_default_grant_file ()
 {
-    char       *p, *tmp, *fname;
+    char       *p, *tmp;
+    const char *fname;
 
     if (dump_base_name)
       fname = dump_base_name; /* Probably invoked via gcc */
@@ -2821,7 +2818,7 @@ really_grant_this (decl, granted_decls)
     }
 
   /* this nerver should happen */
-  error_with_decl (decl, "function \"really_grant_this\" called for `%s'.");
+  error_with_decl (decl, "function \"really_grant_this\" called for `%s'");
   return 1;
 }
 \f
@@ -2993,18 +2990,18 @@ chill_finish_compile ()
         Perhaps rewrite this so nothing is done in pass 1. */
       if (pass == 1)
        {
-         extern char *first_global_object_name;
          /* If we don't do this spoof, we get the name of the first
             tasking_code variable, and not the file name. */
-         char *tmp = first_global_object_name;
-
+         char *q;
+         const char *tmp = first_global_object_name;
          first_global_object_name = NULL;
          chill_init_name = get_file_function_name ('I');
          first_global_object_name = tmp;
+
          /* strip off the file's extension, if any. */
-         tmp = strrchr (IDENTIFIER_POINTER (chill_init_name), '.');
-         if (tmp)
-           *tmp = '\0';
+         q = strrchr (IDENTIFIER_POINTER (chill_init_name), '.');
+         if (q)
+           *q = '\0';
        }
 
       start_chill_function (chill_init_name, void_type_node, NULL_TREE,
@@ -3046,11 +3043,9 @@ chill_finish_compile ()
 
       finish_chill_function ();
 
-      if (pass == 2)
-       {
-         assemble_constructor (IDENTIFIER_POINTER (chill_init_name));
-         globalize_decl (chill_init_function);
-       }
+      if (pass == 2 && targetm.have_ctors_dtors)
+       (* targetm.asm_out.constructor)
+         (XEXP (DECL_RTL (chill_init_function), 0), DEFAULT_INIT_PRIORITY);
 
       /* ready now to link decls onto this list in pass 2. */
       module_init_list = NULL_TREE;