diff options
author | Janus Weil <janus@gcc.gnu.org> | 2013-08-06 10:20:17 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2013-08-06 10:20:17 +0200 |
commit | 2cc6320da1118c535569815d208a07323a566e56 (patch) | |
tree | 36ce544e7013ec1c1973b3bcade5a12c30dd0bc1 /gcc/fortran/trans-decl.c | |
parent | 67d6162ac857b0ad8f2f86be7dca054af52f28d4 (diff) | |
download | gcc-2cc6320da1118c535569815d208a07323a566e56.zip gcc-2cc6320da1118c535569815d208a07323a566e56.tar.gz gcc-2cc6320da1118c535569815d208a07323a566e56.tar.bz2 |
re PR fortran/57306 ([OOP] [F08] ICE on valid with class pointer initialization)
2013-08-06 Janus Weil <janus@gcc.gnu.org>
PR fortran/57306
* class.c (gfc_class_null_initializer): Rename to
'gfc_class_initializer'. Treat non-NULL init-exprs.
* gfortran.h (gfc_class_null_initializer): Update prototype.
* trans-decl.c (gfc_get_symbol_decl): Treat class variables.
* trans-expr.c (gfc_conv_initializer): Ditto.
(gfc_trans_subcomponent_assign): Renamed gfc_class_null_initializer.
2013-08-06 Janus Weil <janus@gcc.gnu.org>
PR fortran/57306
* gfortran.dg/pointer_init_8.f90: New.
From-SVN: r201521
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r-- | gcc/fortran/trans-decl.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 2916b4c..43f401d 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -1491,14 +1491,14 @@ gfc_get_symbol_decl (gfc_symbol * sym) SAVE is specified otherwise they need to be reinitialized every time the procedure is entered. The TREE_STATIC is in this case due to -fmax-stack-var-size=. */ + DECL_INITIAL (decl) = gfc_conv_initializer (sym->value, &sym->ts, - TREE_TYPE (decl), - sym->attr.dimension - || (sym->attr.codimension - && sym->attr.allocatable), - sym->attr.pointer - || sym->attr.allocatable, - sym->attr.proc_pointer); + TREE_TYPE (decl), sym->attr.dimension + || (sym->attr.codimension + && sym->attr.allocatable), + sym->attr.pointer || sym->attr.allocatable + || sym->ts.type == BT_CLASS, + sym->attr.proc_pointer); } if (!TREE_STATIC (decl) |