]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR fortran/93308/93963/94327/94331/97046 problems raised by descriptor handling
authorTobias Burnus <tobias@codesourcery.com>
Mon, 26 Jul 2021 12:20:46 +0000 (14:20 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Mon, 26 Jul 2021 12:32:53 +0000 (14:32 +0200)
commit0cbf03689e3e7d9d6002b8e5d159ef3716d0404c
tree954d333194e1572fb693ffbef91c6d38f558fd67
parent32f7506bdc3956762bcc7dc84133fd7c3a00bb7b
PR fortran/93308/93963/94327/94331/97046 problems raised by descriptor handling

Fortran: Fix attributes and bounds in ISO_Fortran_binding.

2021-07-26  José Rui Faustino de Sousa  <jrfsousa@gmail.com>
    Tobias Burnus  <tobias@codesourcery.com>

PR fortran/93308
PR fortran/93963
PR fortran/94327
PR fortran/94331
PR fortran/97046

gcc/fortran/ChangeLog:

* trans-decl.c (convert_CFI_desc): Only copy out the descriptor
if necessary.
* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Updated attribute
handling which reflect a previous intermediate version of the
standard. Only copy out the descriptor if necessary.

libgfortran/ChangeLog:

* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc): Add code
to verify the descriptor. Correct bounds calculation.
(gfc_desc_to_cfi_desc): Add code to verify the descriptor.

gcc/testsuite/ChangeLog:

* gfortran.dg/ISO_Fortran_binding_1.f90: Add pointer attribute,
this test is still erroneous but now it compiles.
* gfortran.dg/bind_c_array_params_2.f90: Update regex to match
code changes.
* gfortran.dg/PR93308.f90: New test.
* gfortran.dg/PR93963.f90: New test.
* gfortran.dg/PR94327.c: New test.
* gfortran.dg/PR94327.f90: New test.
* gfortran.dg/PR94331.c: New test.
* gfortran.dg/PR94331.f90: New test.
* gfortran.dg/PR97046.f90: New test.
12 files changed:
gcc/fortran/trans-decl.c
gcc/fortran/trans-expr.c
gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.f90
gcc/testsuite/gfortran.dg/PR93308.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/PR93963.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/PR94327.c [new file with mode: 0644]
gcc/testsuite/gfortran.dg/PR94327.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/PR94331.c [new file with mode: 0644]
gcc/testsuite/gfortran.dg/PR94331.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/PR97046.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/bind_c_array_params_2.f90
libgfortran/runtime/ISO_Fortran_binding.c