From 74b1da4b2965a1d33d5ed2f363ce85db9da1ef85 Mon Sep 17 00:00:00 2001
From: brooks <brooks@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 10 Nov 2006 22:34:26 +0000
Subject: [PATCH] * lang.opt (-fmodule-private): Remove option. * gfortran.h
 (gfc_option_t): Remove module_access_private flag. * options.c
 (gfc_init_options): Remove initialization for it. (gfc_process_option):
 Remove handling for -fmodule-private. * module.c (gfc_check_access): Add
 comments, remove check for gfc_option.flag_module_access_private.

(Also fixed tab-damage in preceeding changelog entry.)


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118668 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/fortran/ChangeLog  | 17 +++++++++++++----
 gcc/fortran/gfortran.h |  1 -
 gcc/fortran/lang.opt   |  4 ----
 gcc/fortran/module.c   | 12 +++++-------
 gcc/fortran/options.c  |  5 -----
 5 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 445ed4b77021..be4f8b4b8658 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,9 +1,18 @@
+2006-11-10  Brooks Moses  <brooks.moses@codesourcery.com>
+
+	* lang.opt (-fmodule-private): Remove option.
+	* gfortran.h (gfc_option_t): Remove module_access_private flag.
+	* options.c (gfc_init_options): Remove initialization for it.
+	(gfc_process_option): Remove handling for -fmodule-private.
+	* module.c (gfc_check_access): Add comments, remove check for
+	gfc_option.flag_module_access_private.
+
 2006-11-10 Paul Thomas <pault@gcc.gnu.org>
 
-   PR fortran/29758
-   * check.c (gfc_check_reshape): Check that there are enough
-   elements in the source array as to be able to fill an array
-   defined by shape, when pad is absent.
+	PR fortran/29758
+	* check.c (gfc_check_reshape): Check that there are enough
+	elements in the source array as to be able to fill an array
+	defined by shape, when pad is absent.
 
 2006-11-10 Paul Thomas <pault@gcc.gnu.org>
 
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 05292375c2e4..f78f923d681a 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -1640,7 +1640,6 @@ typedef struct
   int flag_second_underscore;
   int flag_implicit_none;
   int flag_max_stack_var_size;
-  int flag_module_access_private;
   int flag_no_backend;
   int flag_range_check;
   int flag_pack_derived;
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index c055f14a4b37..3409841c9073 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -181,10 +181,6 @@ fmax-stack-var-size=
 Fortran RejectNegative Joined UInteger
 -fmax-stack-var-size=<n>	Size in bytes of the largest array that will be put on the stack
 
-fmodule-private
-Fortran
-Set default accessibility of module entities to PRIVATE
-
 fno-backend
 Fortran RejectNegative
 Don't generate code, just do syntax and semantics checking
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 77ac0e90d81c..92517d85d05e 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -3413,7 +3413,10 @@ read_module (void)
 
 
 /* Given an access type that is specific to an entity and the default
-   access, return nonzero if the entity is publicly accessible.  */
+   access, return nonzero if the entity is publicly accessible.  If the
+   element is declared as PUBLIC, then it is public; if declared 
+   PRIVATE, then private, and otherwise it is public unless the default
+   access in this context has been declared PRIVATE.  */
 
 bool
 gfc_check_access (gfc_access specific_access, gfc_access default_access)
@@ -3424,12 +3427,7 @@ gfc_check_access (gfc_access specific_access, gfc_access default_access)
   if (specific_access == ACCESS_PRIVATE)
     return FALSE;
 
-  if (gfc_option.flag_module_access_private)
-    return default_access == ACCESS_PUBLIC;
-  else
-    return default_access != ACCESS_PRIVATE;
-
-  return FALSE;
+  return default_access != ACCESS_PRIVATE;
 }
 
 
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index ef44ae513244..5d708e23d512 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -73,7 +73,6 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED,
   gfc_option.flag_second_underscore = -1;
   gfc_option.flag_implicit_none = 0;
   gfc_option.flag_max_stack_var_size = 32768;
-  gfc_option.flag_module_access_private = 0;
   gfc_option.flag_no_backend = 0;
   gfc_option.flag_range_check = 1;
   gfc_option.flag_pack_derived = 0;
@@ -521,10 +520,6 @@ gfc_handle_option (size_t scode, const char *arg, int value)
       gfc_option.flag_max_stack_var_size = value;
       break;
 
-    case OPT_fmodule_private:
-      gfc_option.flag_module_access_private = value;
-      break;
-
     case OPT_fno_backend:
       gfc_option.flag_no_backend = value;
       break;
-- 
GitLab