diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2018-09-18 19:35:53 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2018-09-18 19:35:53 +0000 |
commit | f435162f88d89a25dfd00ba3af9b37bb5575fd5e (patch) | |
tree | 0efe85800a6fc611837c2452f402dd81d47b0e0f /gcc/fortran | |
parent | bf8d83098ffafe1273b11eb5f4a596f96c90c42e (diff) | |
download | gcc-f435162f88d89a25dfd00ba3af9b37bb5575fd5e.zip gcc-f435162f88d89a25dfd00ba3af9b37bb5575fd5e.tar.gz gcc-f435162f88d89a25dfd00ba3af9b37bb5575fd5e.tar.bz2 |
re PR fortran/87239 (ICE in deferred-length string)
2018-09-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/87239
* trans-expr.c (gfc_trans_assignment_1): The rse.pre for the
assignment of deferred character elemental function results to
a realocatable lhs must not be added to the exterior block but
must go to the loop body.
2018-09-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/87239
* gfortran.dg/elemental_function_2.f90 : New test.
From-SVN: r264409
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 7 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5f10add..b89ecf8 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,13 @@ 2018-09-18 Paul Thomas <pault@gcc.gnu.org> + PR fortran/87239 + * trans-expr.c (gfc_trans_assignment_1): The rse.pre for the + assignment of deferred character elemental function results to + a realocatable lhs must not be added to the exterior block but + must go to the loop body. + +2018-09-18 Paul Thomas <pault@gcc.gnu.org> + PR fortran/87336 * trans-array.c (gfc_get_array_span): Try to get the element length of incomplete types. Return NULL_TREE otherwise. diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 35052a8..144c666 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -10283,8 +10283,11 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, if (flag_realloc_lhs && expr2->ts.type == BT_CHARACTER && expr1->ts.deferred && !(lss != gfc_ss_terminator - && ((expr2->expr_type == EXPR_OP - && expr2->value.op.op == INTRINSIC_CONCAT) + && ((expr2->expr_type == EXPR_FUNCTION + && expr2->value.function.esym != NULL + && expr2->value.function.esym->attr.elemental) + || (expr2->expr_type == EXPR_OP + && expr2->value.op.op == INTRINSIC_CONCAT) || (expr2->expr_type == EXPR_FUNCTION && expr2->value.function.isym != NULL && expr2->value.function.isym->id == GFC_ISYM_CONVERSION)))) |