From 525a5e33b5c7baafd44ce91b4064148e99b4e97e Mon Sep 17 00:00:00 2001 From: Andre Vehreschild Date: Wed, 18 Jan 2017 20:03:21 +0100 Subject: coarray_alloc_with_implicit_sync_2.f90: New test. gcc/testsuite/ChangeLog: 2017-01-18 Andre Vehreschild * gfortran.dg/coarray_alloc_with_implicit_sync_2.f90: New test. Also fixed date in gcc/testsuite/ChangeLog on my previous commit. gcc/fortran/ChangeLog: 2017-01-18 Andre Vehreschild * primary.c (caf_variable_attr): Improve figuring whether the current component is the last one refed. * trans-stmt.c (gfc_trans_allocate): Do not generate sync_all calls when allocating pointer or allocatable components. From-SVN: r244590 --- gcc/fortran/primary.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gcc/fortran/primary.c') diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index d62f6bb..02e6dc1 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -2449,7 +2449,7 @@ caf_variable_attr (gfc_expr *expr, bool in_allocate, bool *refs_comp) gfc_clear_attr (&attr); if (refs_comp) - *refs_comp = 0; + *refs_comp = false; if (sym->ts.type == BT_CLASS && sym->attr.class_ok) { @@ -2527,8 +2527,10 @@ caf_variable_attr (gfc_expr *expr, bool in_allocate, bool *refs_comp) allocatable = comp->attr.allocatable; } - if (refs_comp && strcmp (comp->name, "_data") != 0) - *refs_comp = 1; + if (refs_comp && strcmp (comp->name, "_data") != 0 + && (ref->next == NULL + || (ref->next->type == REF_ARRAY && ref->next->next == NULL))) + *refs_comp = true; if (pointer || attr.proc_pointer) target = 1; -- cgit v1.1