https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94672
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tobias Burnus <bur...@gcc.gnu.org>: https://gcc.gnu.org/g:892c7427ee234c04852e90d9ce32913a429adf9d commit r11-271-g892c7427ee234c04852e90d9ce32913a429adf9d Author: Tobias Burnus <tob...@codesourcery.com> Date: Mon May 11 16:39:20 2020 +0200 [Fortran] Fix/modify present() handling for assumed-shape optional (PR 94672) gcc/fortran/ 2020-05-07 Tobias Burnus <tob...@codesourcery.com> PR fortran/94672 * trans.h (gfc_conv_expr_present): Add use_saved_decl=false argument. * trans-expr.c (gfc_conv_expr_present): Likewise; use DECL directly and only if use_saved_decl is true, use the actual PARAM_DECL arg (saved descriptor). * trans-array.c (gfc_trans_dummy_array_bias): Set local 'arg.0' variable to NULL if 'arg' is not present. * trans-openmp.c (gfc_omp_check_optional_argument): Simplify by checking 'arg.0' instead of the true PARM_DECL. (gfc_omp_finish_clause): Remove setting 'arg.0' to NULL. gcc/testsuite/ 2020-05-07 Jakub Jelinek <ja...@redhat.com> Tobias Burnus <tob...@codesourcery.com> PR fortran/94672 * gfortran.dg/gomp/pr94672.f90: New. * gfortran.dg/missing_optional_dummy_6a.f90: Update scan-tree.