aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/primary.c
diff options
context:
space:
mode:
authorAndre Vehreschild <vehre@gcc.gnu.org>2017-01-18 20:03:21 +0100
committerAndre Vehreschild <vehre@gcc.gnu.org>2017-01-18 20:03:21 +0100
commit525a5e33b5c7baafd44ce91b4064148e99b4e97e (patch)
tree0e7b010f1a68af7ad7a71ad2014b55bb31002394 /gcc/fortran/primary.c
parent29dbb95abad227198858d6cbd0315eca7b27a821 (diff)
downloadgcc-525a5e33b5c7baafd44ce91b4064148e99b4e97e.zip
gcc-525a5e33b5c7baafd44ce91b4064148e99b4e97e.tar.gz
gcc-525a5e33b5c7baafd44ce91b4064148e99b4e97e.tar.bz2
coarray_alloc_with_implicit_sync_2.f90: New test.
gcc/testsuite/ChangeLog: 2017-01-18 Andre Vehreschild <vehre@gcc.gnu.org> * 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 <vehre@gcc.gnu.org> * 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
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r--gcc/fortran/primary.c8
1 files changed, 5 insertions, 3 deletions
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;