Le 03/10/2012 18:48, Janus Weil a écrit :
> Hi all,
> 
> here is a small patch for a wrong-code regression with polymorphic
> allocation. The problem is that we falsely detect the allocation
> variable to be a polymorphic array (although it is a scalar). For
> further details see the PR, in particular comment 4.
> 
> Regtested on x86_64-unknown-linux-gnu. Ok for trunk and 4.7?
Hello, the fix looks incomplete.

> 
> Index: gcc/fortran/trans-stmt.c
> ===================================================================
> --- gcc/fortran/trans-stmt.c  (revision 192004)
> +++ gcc/fortran/trans-stmt.c  (working copy)
> @@ -5145,7 +5145,9 @@ gfc_trans_allocate (gfc_code * code)
>             dataref = actual->next->expr->ref;
>             /* Make sure we go up through the reference chain to
>                the _data reference, where the arrayspec is found.  */
> -           while (dataref->next && dataref->next->type != REF_ARRAY)
> +           while (!(dataref->type == REF_COMPONENT
> +                    && strcmp (dataref->u.c.component->name, "_data") == 0)
> +                  && dataref->next)
this stops on the first class reference, while it seems to me that it
should stop on the last.

Mikael

Reply via email to