https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71783

--- Comment #6 from Toon Moene <toon at moene dot org> ---
On 07/08/2016 11:15 PM, tkoenig at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71783
>
> --- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
> The solution turns that fixes the ICE turns out to be reasonably simple: We
> were missing a charlen for the allocatable case.
>
> What I do not yet understand is why this code was reached in the first place;
> the temporary assignment should never happen for this case.
>
> Index: frontend-passes.c
> ===================================================================
> --- frontend-passes.c   (Revision 237949)
> +++ frontend-passes.c   (Arbeitskopie)
> @@ -665,12 +665,10 @@ create_var (gfc_expr * e, const char *vname)
>      {
>        gfc_expr *length;
>
> +      symbol->ts.u.cl = gfc_new_charlen (ns, NULL);
>        length = constant_string_length (e);
>        if (length)
> -       {
> -         symbol->ts.u.cl = gfc_new_charlen (ns, NULL);
> -         symbol->ts.u.cl->length = length;
> -       }
> +       symbol->ts.u.cl->length = length;
>        else
>         symbol->attr.allocatable = 1;
>      }
>
> Toon, does this fix the ICE for you as well?

This works for me on trunk - it is hard to see whether it invokes 
regressions, because those have been varying with various targets ...

Nevertheless, looks OK as a solution.

Thanks,

Reply via email to