OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / f / top.c
index 641bd39..6eba5c9 100644 (file)
@@ -1,6 +1,6 @@
 /* top.c -- Implementation File (module.c template V1.0)
-   Copyright (C) 1995-1997 Free Software Foundation, Inc.
-   Contributed by James Craig Burley (burley@gnu.ai.mit.edu).
+   Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+   Contributed by James Craig Burley.
 
 This file is part of GNU Fortran.
 
@@ -30,7 +30,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 /* Include files. */
 
-#include <ctype.h>
 #include "proj.h"
 #include "top.h"
 #include "bad.h"
@@ -55,17 +54,18 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "target.h"
 #include "where.h"
 #if FFECOM_targetCURRENT == FFECOM_targetGCC
-#include "flags.j"
+#include "flags.h"
+#include "toplev.h"
 #endif
 
 /* Externals defined here. */
 
 int flag_traditional;          /* Shouldn't need this (C front end only)! */
-bool ffe_is_do_internal_checks_ = TRUE;
+bool ffe_is_do_internal_checks_ = FALSE;
 bool ffe_is_90_ = FFETARGET_defaultIS_90;
 bool ffe_is_automatic_ = FFETARGET_defaultIS_AUTOMATIC;
 bool ffe_is_backslash_ = FFETARGET_defaultIS_BACKSLASH;
-bool ffe_is_emulate_complex_ = TRUE;
+bool ffe_is_emulate_complex_ = FALSE;
 bool ffe_is_underscoring_ = FFETARGET_defaultEXTERNAL_UNDERSCORED
   || FFETARGET_defaultUNDERSCORED_EXTERNAL_UNDERSCORED;
 bool ffe_is_second_underscore_ = FFETARGET_defaultUNDERSCORED_EXTERNAL_UNDERSCORED;
@@ -74,12 +74,13 @@ bool ffe_is_dollar_ok_ = FFETARGET_defaultIS_DOLLAR_OK;
 bool ffe_is_f2c_ = FFETARGET_defaultIS_F2C;
 bool ffe_is_f2c_library_ = FFETARGET_defaultIS_F2C_LIBRARY;
 bool ffe_is_ffedebug_ = FALSE;
+bool ffe_is_flatten_arrays_ = FALSE;
 bool ffe_is_free_form_ = FFETARGET_defaultIS_FREE_FORM;
 bool ffe_is_globals_ = TRUE;
-bool ffe_is_ident_ = TRUE;
 bool ffe_is_init_local_zero_ = FFETARGET_defaultIS_INIT_LOCAL_ZERO;
 bool ffe_is_mainprog_;         /* TRUE if current prog unit known to be
                                   main. */
+bool ffe_is_null_version_ = FALSE;
 bool ffe_is_onetrip_ = FALSE;
 bool ffe_is_silent_ = TRUE;
 bool ffe_is_typeless_boz_ = FALSE;
@@ -150,7 +151,7 @@ ffe_is_digit_string_ (char *s)
 {
   char *p;
 
-  for (p = s; isdigit (*p); ++p)
+  for (p = s; ISDIGIT (*p); ++p)
     ;
 
   return (p != s) && (*p == '\0');
@@ -160,33 +161,22 @@ ffe_is_digit_string_ (char *s)
    recognized and handled.  */
 
 int
-ffe_decode_option (char *opt)
+ffe_decode_option (argc, argv)
+     int argc ATTRIBUTE_UNUSED;
+     char **argv;
 {
+  char *opt = argv[0];
   if (opt[0] != '-')
     return 0;
   if (opt[1] == 'f')
     {
       if (strcmp (&opt[2], "version") == 0)
-       ffe_set_is_version (TRUE);
-      else if (strcmp (&opt[2], "null-version") == 0)
-       ;                       /* Someday generate program to print version
-                                  info.  */
-      else if (strcmp (&opt[2], "set-g77-defaults") == 0)
        {
-         ffe_is_do_internal_checks_ = 0;
-#if BUILT_FOR_270      /* User must have applied patch (circa 2.7.2 and beyond). */
-#if 0
-         flag_rerun_loop_opt = 1;
-#endif
-         flag_move_all_movables = 1;
-         flag_reduce_all_givs = 1;
-         flag_argument_noalias = 2;
-#endif
+         ffe_set_is_version (TRUE);
+         ffe_set_is_do_internal_checks (TRUE);
        }
-      else if (strcmp (&opt[2], "ident") == 0)
-       ffe_set_is_ident (TRUE);
-      else if (strcmp (&opt[2], "no-ident") == 0)
-       ffe_set_is_ident (FALSE);
+      else if (strcmp (&opt[2], "null-version") == 0)
+       ffe_set_is_null_version (TRUE);
       else if (strcmp (&opt[2], "f66") == 0)
        {
          ffe_set_is_onetrip (TRUE);
@@ -226,6 +216,10 @@ ffe_decode_option (char *opt)
        ffe_set_is_f2c_library (TRUE);
       else if (strcmp (&opt[2], "no-f2c-library") == 0)
        ffe_set_is_f2c_library (FALSE);
+      else if (strcmp (&opt[2], "flatten-arrays") == 0)
+       ffe_set_is_flatten_arrays (TRUE);
+      else if (strcmp (&opt[2], "no-flatten-arrays") == 0)
+       ffe_set_is_flatten_arrays (FALSE);
       else if (strcmp (&opt[2], "free-form") == 0)
        ffe_set_is_free_form (TRUE);
       else if (strcmp (&opt[2], "no-free-form") == 0)
@@ -246,18 +240,6 @@ ffe_decode_option (char *opt)
        warning ("%s no longer supported -- try -fvxt", opt);
       else if (strcmp (&opt[2], "f90-not-vxt") == 0)
        warning ("%s no longer supported -- try -fno-vxt -ff90", opt);
-      else if (strcmp (&opt[2], "ugly") == 0)
-       {
-         warning ("%s is overloaded with meanings and likely to be removed;", opt);
-         warning ("use only the specific -fugly-* options you need");
-         ffe_set_is_ugly_args (TRUE);
-         ffe_set_is_ugly_assign (TRUE);
-         ffe_set_is_ugly_assumed (TRUE);
-         ffe_set_is_ugly_comma (TRUE);
-         ffe_set_is_ugly_complex (TRUE);
-         ffe_set_is_ugly_init (TRUE);
-         ffe_set_is_ugly_logint (TRUE);
-       }
       else if (strcmp (&opt[2], "no-ugly") == 0)
        {
          ffe_set_is_ugly_args (FALSE);
@@ -325,9 +307,9 @@ ffe_decode_option (char *opt)
       else if (strcmp (&opt[2], "no-zeros") == 0)
        ffe_set_is_zeros (FALSE);
       else if (strcmp (&opt[2], "debug-kludge") == 0)
-       ffe_set_is_debug_kludge (TRUE);
+       warning ("%s disabled, use normal debugging flags", opt);
       else if (strcmp (&opt[2], "no-debug-kludge") == 0)
-       ffe_set_is_debug_kludge (FALSE);
+       warning ("%s disabled, use normal debugging flags", opt);
       else if (strcmp (&opt[2], "onetrip") == 0)
        ffe_set_is_onetrip (TRUE);
       else if (strcmp (&opt[2], "no-onetrip") == 0)
@@ -340,6 +322,10 @@ ffe_decode_option (char *opt)
        ffe_set_is_globals (TRUE);
       else if (strcmp (&opt[2], "no-globals") == 0)
        ffe_set_is_globals (FALSE);
+      else if (strcmp (&opt[2], "fortran-bounds-check") == 0)
+       flag_bounds_check = TRUE;
+      else if (strcmp (&opt[2], "no-fortran-bounds-check") == 0)
+       flag_bounds_check = FALSE;
       else if (strcmp (&opt[2], "typeless-boz") == 0)
        ffe_set_is_typeless_boz (TRUE);
       else if (strcmp (&opt[2], "no-typeless-boz") == 0)
@@ -524,7 +510,7 @@ ffe_decode_option (char *opt)
             warning about not using it without also specifying -O.  */
          if (warn_uninitialized != 1)
            warn_uninitialized = 2;
-         warn_unused = 1;
+         set_Wunused (1);
        }
       else
        return 0;