diff options
author | Harald Anlauf <anlauf@gmx.de> | 2020-12-17 10:31:55 +0100 |
---|---|---|
committer | Harald Anlauf <anlauf@gmx.de> | 2020-12-17 10:31:55 +0100 |
commit | c09deceb534b82ce144af3a345dcb06ab5e49ba4 (patch) | |
tree | 5d9f001ddc5608e2c298a995ff54e48c87e02f0c /gcc/fortran | |
parent | 6f8486523f61bf0aa476dfa4197d1e3b71a0a8f3 (diff) | |
download | gcc-c09deceb534b82ce144af3a345dcb06ab5e49ba4.zip gcc-c09deceb534b82ce144af3a345dcb06ab5e49ba4.tar.gz gcc-c09deceb534b82ce144af3a345dcb06ab5e49ba4.tar.bz2 |
PR fortran/98307 - Dependency check fails when using "allocatable"
The dependency check for FORALL constructs already handled pointer
components to derived types, but missed allocatables. Fix that.
gcc/fortran/ChangeLog:
PR fortran/98307
* trans-stmt.c (check_forall_dependencies): Extend dependency
check to allocatable components of derived types.
gcc/testsuite/ChangeLog:
PR fortran/98307
* gfortran.dg/forall_19.f90: New test.
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/trans-stmt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index adc6b8f..112a4e8 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -3949,9 +3949,10 @@ check_forall_dependencies (gfc_code *c, stmtblock_t *pre, stmtblock_t *post) point to the copy instead. Note that the shallow copy of the variable will not suffice for derived types with pointer components. We therefore leave these to their - own devices. */ + own devices. Likewise for allocatable components. */ if (lsym->ts.type == BT_DERIVED - && lsym->ts.u.derived->attr.pointer_comp) + && (lsym->ts.u.derived->attr.pointer_comp + || lsym->ts.u.derived->attr.alloc_comp)) return need_temp; new_symtree = NULL; |