diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2019-03-30 15:39:00 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2019-03-30 15:39:00 +0000 |
commit | 0324a4978e151e4a1cb5aa93265d2876af581baa (patch) | |
tree | ae9d1769c1ae90eb7bade550e0d0f829de2dc8bd /gcc/fortran/trans-expr.c | |
parent | 26b81a446f6e333bb5e80d40eb467260948ee79e (diff) | |
download | gcc-0324a4978e151e4a1cb5aa93265d2876af581baa.zip gcc-0324a4978e151e4a1cb5aa93265d2876af581baa.tar.gz gcc-0324a4978e151e4a1cb5aa93265d2876af581baa.tar.bz2 |
re PR fortran/89841 (improper descriptor information passed to C)
2019-03-30 Paul Thomas <pault@gcc.gnu.org>
PR fortran/89841
* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Use the formal
argument attributes rather than those of the actual argument.
PR fortran/89842
* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Call
'set_dtype_for_unallocated' for any type of arrayspec.
2019-03-30 Paul Thomas <pault@gcc.gnu.org>
PR fortran/89841
* gfortran.dg/ISO_Fortran_binding_1.f90: Change the interfaces
for c_deallocate, c_allocate and c_assumed_size so that the
attributes of the array arguments are correct and are typed.
* gfortran.dg/ISO_Fortran_binding_7.f90: New test.
* gfortran.dg/ISO_Fortran_binding_7.c: Additional source.
PR fortran/89842
* gfortran.dg/ISO_Fortran_binding_8.f90: New test.
* gfortran.dg/ISO_Fortran_binding_8.c: Additional source.
From-SVN: r270037
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r-- | gcc/fortran/trans-expr.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 19fb16f..434c989 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -4998,9 +4998,9 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym) attribute = 2; if (!e->rank || gfc_get_full_arrayspec_from_expr (e)) { - if (attr.pointer) + if (fsym->attr.pointer) attribute = 0; - else if (attr.allocatable) + else if (fsym->attr.allocatable) attribute = 1; } @@ -5021,7 +5021,6 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym) need their dtype setting if they are argument associated with assumed rank dummies. */ if (fsym && fsym->as - && fsym->as->type == AS_ASSUMED_RANK && (gfc_expr_attr (e).pointer || gfc_expr_attr (e).allocatable)) set_dtype_for_unallocated (parmse, e); |