[Patch, fortran] PR85954 - [8/9 Regression] ICE in make_ssa_name_fn, at tree-ssanames.c:266

Paul Richard Thomas paul.richard.thomas@gmail.com
Sun Sep 16 16:58:00 GMT 2018


I spent far more time on this PR because I was focusing on entirely
the wrong place in the code. Or, rather the clue that was needed for
the fix was elswhere. The type declarations for the deferred character
length dummies were not being generated. Rather than being a problem
in the associate block, as I thought initially, it turned out to be
the cast in print *, allocated(x),..... that was throwing the
gimplifier in its attempt to inline the subroutine. The fix is clear
from the ChangeLog.

It did turn out that there was something wrong with the associate
block: The associate name was ending up with no charlen and so winding
up with a descriptor appropriate to a bind(C) function result.

Bootstraps and regtests on FC28/x86_64 - OK for trunk and 8-branch?

Paul

2018-09-16  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/85954
    * resolve.c (resolve_assoc_var): If the target expression is a
    deferred charlen dummy and the associate name shares the
    charlen, generate a new one. Make sure that new charlens are in
    the namespace list so that they get cleaned up.
    * trans-array.c (gfc_is_reallocatable_lhs): Associate names are
    not reallocatable.
    * trans-decl.c (gfc_get_symbol_decl): Put deferred character
    length dummy and result arrays on the deferred initialization
    list so that the variable length arrays can be correctly dealt
    with.
    * trans-expr.c (gfc_conv_string_length): Return if 'expr' is
    NULL rather than ICEing..

2018-09-16  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/85954
    * gfortran.dg/deferred_character_21.f90 : New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: commit.diff
Type: text/x-patch
Size: 4416 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180916/c2260f17/attachment.bin>


More information about the Gcc-patches mailing list