aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorVictor Leikehman <lei@haifasphere.co.il>2004-05-15 01:52:04 +0300
committerPaul Brook <pbrook@gcc.gnu.org>2004-05-14 22:52:04 +0000
commitcb44ab824bd0902002bbf1caa66c05b56829630c (patch)
tree939f71ae9665cb55420bcc4ffa9d70f3850da94c /gcc/fortran
parent15f8ac7f0878178cca61636f81323629624e4585 (diff)
downloadgcc-cb44ab824bd0902002bbf1caa66c05b56829630c.zip
gcc-cb44ab824bd0902002bbf1caa66c05b56829630c.tar.gz
gcc-cb44ab824bd0902002bbf1caa66c05b56829630c.tar.bz2
decl.c (variable_decl): Always apply default initializer.
fortran/ * decl.c (variable_decl): Always apply default initializer. libgfortran/ * gfortran.fortran-torture/execute/def_init_3.f90: New test. From-SVN: r81865
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog4
-rw-r--r--gcc/fortran/decl.c9
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 605a572..19a66ce 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-14 Victor Leikehman <lei@haifasphere.co.il>
+
+ * decl.c (variable_decl): Always apply default initializer.
+
2004-05-08 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/15206
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 9d6bf94..2aed9b2 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -619,10 +619,11 @@ variable_decl (void)
if (m != MATCH_YES)
goto cleanup;
}
- else if (current_ts.type == BT_DERIVED)
- {
- initializer = default_initializer ();
- }
+ }
+
+ if (current_ts.type == BT_DERIVED && !initializer)
+ {
+ initializer = default_initializer ();
}
/* Add the initializer. Note that it is fine if &initializer is