diff options
author | Andre Vehreschild <vehre@gcc.gnu.org> | 2016-02-03 11:39:09 +0100 |
---|---|---|
committer | Andre Vehreschild <vehre@gcc.gnu.org> | 2016-02-03 11:39:09 +0100 |
commit | 781d83d96d15ee03d845d6f2894d1d76ee24e79a (patch) | |
tree | 7c15a44a869671762c2f0e4969d988f28b52fb6f /gcc/fortran/trans-expr.c | |
parent | d8208e6d4c172278488f7fbc0b4f58fd3c490bd9 (diff) | |
download | gcc-781d83d96d15ee03d845d6f2894d1d76ee24e79a.zip gcc-781d83d96d15ee03d845d6f2894d1d76ee24e79a.tar.gz gcc-781d83d96d15ee03d845d6f2894d1d76ee24e79a.tar.bz2 |
re PR fortran/67451 ([F08] ICE with sourced allocation from coarray.)
gcc/testsuite/ChangeLog:
2016-02-03 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/67451
PR fortran/69418
* gfortran.dg/coarray_allocate_2.f08: New test.
* gfortran.dg/coarray_allocate_3.f08: New test.
* gfortran.dg/coarray_allocate_4.f08: New test.
gcc/fortran/ChangeLog:
2016-02-03 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/67451
PR fortran/69418
* trans-expr.c (gfc_copy_class_to_class): For coarrays just the
pointer is passed. Take it as is without trying to deref the
_data component.
* trans-stmt.c (gfc_trans_allocate): Take care of coarrays as
argument to source=-expression.
From-SVN: r233101
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r-- | gcc/fortran/trans-expr.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 08b20e6..87af7ac 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -1103,7 +1103,14 @@ gfc_copy_class_to_class (tree from, tree to, tree nelems, bool unlimited) } else { - from_data = gfc_class_data_get (from); + /* Check that from is a class. When the class is part of a coarray, + then from is a common pointer and is to be used as is. */ + tmp = POINTER_TYPE_P (TREE_TYPE (from)) + ? build_fold_indirect_ref (from) : from; + from_data = + (GFC_CLASS_TYPE_P (TREE_TYPE (tmp)) + || (DECL_P (tmp) && GFC_DECL_CLASS (tmp))) + ? gfc_class_data_get (from) : from; is_from_desc = GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (from_data)); } } |