]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/51310 (-finit-bla doesn't initialize *all* items of type bla to the...
authorToon Moene <toon@moene.org>
Thu, 22 Dec 2011 19:23:26 +0000 (19:23 +0000)
committerToon Moene <toon@gcc.gnu.org>
Thu, 22 Dec 2011 19:23:26 +0000 (19:23 +0000)
2011-12-22  Toon Moene  <toon@moene.org>

PR fortran/51310
* resolve.c (build_default_init_expr): Allow non-allocatable,
non-compile-time-constant-shape arrays to have a default
initializer.
* invoke.texi: Delete the restriction on automatic arrays not
being initialized by -finit-<type>=<constant>.

From-SVN: r182634

gcc/fortran/ChangeLog
gcc/fortran/invoke.texi
gcc/fortran/resolve.c

index c054e70b9e445fe8fe64890acc57a94252d526f7..503c9bb9ad2ba8182787628a8a624be36066eadb 100644 (file)
@@ -1,3 +1,12 @@
+2011-12-22  Toon Moene  <toon@moene.org>
+
+       PR fortran/51310
+       * resolve.c (build_default_init_expr): Allow non-allocatable,
+       non-compile-time-constant-shape arrays to have a default
+       initializer.
+       * invoke.texi: Delete the restriction on automatic arrays not
+       being initialized by -finit-<type>=<constant>.
+
 2011-12-15  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/51550
index f9d0eb3e5ca74edd7a4c6e3f15eb176504a49fdf..9b53962346ecad4e38a6e5b21cb5e40d4f0e648e 100644 (file)
@@ -1441,8 +1441,6 @@ the real and imaginary parts of local @code{COMPLEX} variables),
 value) options.  These options do not initialize
 @itemize @bullet
 @item
-automatic arrays
-@item
 allocatable arrays
 @item
 components of derived type variables
index 7414db0c5d5bf4854bfc03058cb91e699bd03281..8d1ef0f1af8d0646bec30a149f5f5bd348e9ba2e 100644 (file)
@@ -9690,7 +9690,7 @@ build_default_init_expr (gfc_symbol *sym)
   int i;
 
   /* These symbols should never have a default initialization.  */
-  if ((sym->attr.dimension && !gfc_is_compile_time_shape (sym->as))
+  if (sym->attr.allocatable
       || sym->attr.external
       || sym->attr.dummy
       || sym->attr.pointer