Fortran: Fix absent-optional handling for nondescriptor arrays (PR94672)
authorTobias Burnus <tobias@codesourcery.com>
Fri, 28 Aug 2020 11:54:10 +0000 (13:54 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Fri, 28 Aug 2020 11:54:10 +0000 (13:54 +0200)
commitcb3c3d63315ceb4dc262e5efb83b42c73c43387d
treea31c6b5ab69e7883905bc4591157d059fefc8382
parentb648814c02eb418aaf27897c480452172ee96303
Fortran: Fix absent-optional handling for nondescriptor arrays (PR94672)

gcc/fortran/ChangeLog:

PR fortran/94672
* trans-array.c (gfc_trans_g77_array): Check against the parm decl and
set the nonparm decl used for the is-present check to NULL if absent.

gcc/testsuite/ChangeLog:

PR fortran/94672
* gfortran.dg/optional_assumed_charlen_2.f90: New test.
gcc/fortran/trans-array.c
gcc/testsuite/gfortran.dg/optional_assumed_charlen_2.f90 [new file with mode: 0644]