[Bug fortran/33566] fortran : wrong rank of derived type parameters array components

pault at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Sep 28 15:48:00 GMT 2007



------- Comment #1 from pault at gcc dot gnu dot org  2007-09-28 15:48 -------
It transpires that the fix that I used for use associated, derived type
parameters works here too:

Index: gcc/fortran/primary.c
===================================================================
*** gcc/fortran/primary.c       (révision 128833)
--- gcc/fortran/primary.c       (copie de travail)
*************** gfc_match_rvalue (gfc_expr **result)
*** 2148,2159 ****
        if (sym->ts.is_c_interop || sym->ts.is_iso_c)
        break;

!       /* Variable array references to use associated derived type
!        parameters cause all sorts of headaches in simplification.
!        For this reason, we write the parameter to the module and
!        treat them as variable references.  */
!       if (sym->value && sym->ts.type == BT_DERIVED
!           && sym->attr.use_assoc && e->ref)
        {
          for (ref = e->ref; ref; ref = ref->next)
            if (ref->type == REF_ARRAY)
--- 2148,2157 ----
        if (sym->ts.is_c_interop || sym->ts.is_iso_c)
        break;

!       /* Variable array references to derived type parameters cause
!        all sorts of headaches in simplification.  For this reason,
!        we treat them as variable references.  */
!       if (sym->value && sym->ts.type == BT_DERIVED && e->ref)
        {
          for (ref = e->ref; ref; ref = ref->next)
            if (ref->type == REF_ARRAY)

I'll regtest and submit it.

Cheers

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-09-26 19:12:48         |2007-09-28 15:48:17
               date|                            |


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



More information about the Gcc-bugs mailing list