------- Comment #2 from pault at gcc dot gnu dot org  2007-07-26 20:02 -------
This is fixed by:

Index: gcc/fortran/trans-decl.c
===================================================================
--- gcc/fortran/trans-decl.c    (revision 126885)
+++ gcc/fortran/trans-decl.c    (working copy)
@@ -2735,8 +2735,7 @@

       /* If an INTENT(OUT) dummy of derived type has a default
         initializer, it must be initialized here.  */
-      if (f->sym && f->sym->attr.referenced
-           && f->sym->attr.intent == INTENT_OUT
+      if (f->sym && f->sym->attr.intent == INTENT_OUT
            && f->sym->ts.type == BT_DERIVED
            && !f->sym->ts.derived->attr.alloc_comp
            && f->sym->value)
@@ -2744,6 +2743,7 @@
          gfc_expr *tmpe;
          tree tmp, present;
          gcc_assert (!f->sym->attr.allocatable);
+         gfc_set_sym_referenced (f->sym);
          tmpe = gfc_lval_expr_from_sym (f->sym);
          tmp = gfc_trans_assignment (tmpe, f->sym->value, false);

I'll regtest and check against cp2k before committing as obvious.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-07-26 19:27:24         |2007-07-26 20:02:36
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32903

Reply via email to