diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2019-03-27 12:51:43 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2019-03-27 12:51:43 +0000 |
commit | d5f48c7c62d3d8cf8982cb29a8128e3b81335d24 (patch) | |
tree | 76bbc93eb20c9c454b06f631c411d2415a8c5992 /gcc/fortran/expr.c | |
parent | 6461f211e09415edd95315f4f9ff843f4f1d8eff (diff) |
re PR fortran/88247 (ICE in get_array_ctor_var_strlen, at fortran/trans-array.c:2068)
2019-03-27 Paul Thomas <pault@gcc.gnu.org>
PR fortran/88247
* expr.c (is_subref_array): Permit substrings to be detected
as subref arrays.
* trans-array.c (get_array_ctor_var_strlen): Obtain the length
of deferred length strings. Handle substrings with a NULL end
expression.
(trans_array_constructor): Remove an unnecessary blank line.
(gfc_conv_scalarized_array_ref): Skip to label 'done' if 'decl'
is a pointer array.
(get_array_charlen): If the expression is an array, convert the
first element of the constructor and use its string length. Get
a new charlen if necessary.
(gfc_conv_expr_descriptor): Call 'get_array_charlen' for array
constructor expressions. If the ss_info string length is
available, use that to set the span of character arrays.
* trans-expr.c (gfc_get_expr_charlen): Handle substrings
* trans-stmt.c (trans_associate_var): Set the pointer array
flag for variable targets and constant array constructors. Take
care not to reset the string length or the span in the case of
expressions that are not converted as direct by reference.
2019-03-27 Paul Thomas <pault@gcc.gnu.org>
PR fortran/88247
* gfortran.dg/associate_47.f90: New test.
From-SVN: r269962
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 4c76f539031f..f54affae18dc 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -1080,8 +1080,10 @@ is_subref_array (gfc_expr * e) for (ref = e->ref; ref; ref = ref->next) { /* If we haven't seen the array reference and this is an intrinsic, - what follows cannot be a subreference array. */ + what follows cannot be a subreference array, unless there is a + substring reference. */ if (!seen_array && ref->type == REF_COMPONENT + && ref->u.c.component->ts.type != BT_CHARACTER && ref->u.c.component->ts.type != BT_CLASS && !gfc_bt_struct (ref->u.c.component->ts.type)) return false; |