re PR fortran/51310 (-finit-bla doesn't initialize *all* items of type bla to the...
authorToon Moene <toon@moene.org>
Thu, 15 Dec 2011 18:26:02 +0000 (18:26 +0000)
committerToon Moene <toon@gcc.gnu.org>
Thu, 15 Dec 2011 18:26:02 +0000 (18:26 +0000)
2011-12-15  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

From-SVN: r182384

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

index 5175e41cab87e5e9e5e62df448d5903368fa7232..e2f95250f7c5d92ff3aa6fa8b059063d2fa4d72a 100644 (file)
@@ -1,3 +1,11 @@
+2011-12-15  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
+
 2011-12-15  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/51550
index f25af405c9ab6b21f2dec9ab4146fa14e7a3254a..e2661f34a8e29832407f69b1dc522f7d5dc74819 100644 (file)
@@ -1474,8 +1474,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 b12efe0dc546ba7d61756f3251e08da35f78a505..e99e1997cde26c69c52970957929436e0e479b2d 100644 (file)
@@ -9900,7 +9900,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