From d19159d8e176a607098605cdc8d038526e45e7dd Mon Sep 17 00:00:00 2001 From: Toon Moene Date: Thu, 22 Dec 2011 19:23:26 +0000 Subject: [PATCH] re PR fortran/51310 (-finit-bla doesn't initialize *all* items of type bla to the requested constant.) 2011-12-22 Toon Moene 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-=. From-SVN: r182634 --- gcc/fortran/ChangeLog | 9 +++++++++ gcc/fortran/invoke.texi | 2 -- gcc/fortran/resolve.c | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index c054e70b9e44..503c9bb9ad2b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,12 @@ +2011-12-22 Toon Moene + + 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-=. + 2011-12-15 Tobias Burnus PR fortran/51550 diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi index f9d0eb3e5ca7..9b53962346ec 100644 --- a/gcc/fortran/invoke.texi +++ b/gcc/fortran/invoke.texi @@ -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 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 7414db0c5d5b..8d1ef0f1af8d 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -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 -- 2.47.2