diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2018-10-01 14:27:17 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2018-10-01 14:27:17 +0000 |
commit | b093d688daa4c6e131007aaa397a55489d5b7ccb (patch) | |
tree | b9b1105ae05aabb4969bf2181c1660462e1e125f /gcc/fortran | |
parent | fd5c626c681266845dbec0e84836823a5de3a45b (diff) | |
download | gcc-b093d688daa4c6e131007aaa397a55489d5b7ccb.zip gcc-b093d688daa4c6e131007aaa397a55489d5b7ccb.tar.gz gcc-b093d688daa4c6e131007aaa397a55489d5b7ccb.tar.bz2 |
re PR fortran/65677 (Incomplete assignment on deferred-length character variable)
2018-10-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/65677
* trans-expr.c (gfc_trans_assignment_1): Set the 'identical'
flag in the call to gfc_check_dependency.
2018-10-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/65677
* gfortran.dg/dependency_52.f90 : Expand the test to check both
the call to adjustl and direct assignment of the substring.
From-SVN: r264759
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/dependency.c | 4 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 4 |
3 files changed, 11 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 399d6f9..d513f2a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2018-10-01 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/65677 + * trans-expr.c (gfc_trans_assignment_1): Set the 'identical' + flag in the call to gfc_check_dependency. + 2018-09-30 Paul Thomas <pault@gcc.gnu.org> PR fortran/87359 @@ -33,7 +39,7 @@ 2018-09-29 Paul Thomas <pault@gcc.gnu.org> - PR fortran/65667 + PR fortran/65677 * trans-expr.c (gfc_trans_assignment_1): If there is dependency fix the rse stringlength. diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c index a0bbd58..86359e5 100644 --- a/gcc/fortran/dependency.c +++ b/gcc/fortran/dependency.c @@ -240,7 +240,7 @@ gfc_dep_compare_functions (gfc_expr *e1, gfc_expr *e2, bool impure_ok) /* Special case: String arguments which compare equal can have different lengths, which makes them different in calls to procedures. */ - + if (e1->expr_type == EXPR_CONSTANT && e1->ts.type == BT_CHARACTER && e2->expr_type == EXPR_CONSTANT @@ -1907,7 +1907,7 @@ dummy_intent_not_in (gfc_expr **ep) /* Determine if an array ref, usually an array section specifies the entire array. In addition, if the second, pointer argument is provided, the function will return true if the reference is - contiguous; eg. (:, 1) gives true but (1,:) gives false. + contiguous; eg. (:, 1) gives true but (1,:) gives false. If one of the bounds depends on a dummy variable which is not INTENT(IN), also return false, because the user may have changed the variable. */ diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 9824848..37052b6 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -5281,7 +5281,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, /* See PR 41453. */ && !e->symtree->n.sym->attr.dummy /* FIXME - PR 87395 and PR 41453 */ - && e->symtree->n.sym->attr.save == SAVE_NONE + && e->symtree->n.sym->attr.save == SAVE_NONE && !e->symtree->n.sym->attr.associate_var && e->ts.type != BT_CHARACTER && e->ts.type != BT_DERIVED && e->ts.type != BT_CLASS && !sym->attr.elemental; @@ -10208,7 +10208,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, string_length = gfc_evaluate_now (rse.string_length, &rse.pre); else if (expr2->ts.type == BT_CHARACTER) { - if (expr1->ts.deferred && gfc_check_dependency (expr1, expr2, false)) + if (expr1->ts.deferred && gfc_check_dependency (expr1, expr2, true)) rse.string_length = gfc_evaluate_now (rse.string_length, &rse.pre); string_length = rse.string_length; } |