https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41453
--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- Author: tkoenig Date: Sat Sep 22 18:44:01 2018 New Revision: 264506 URL: https://gcc.gnu.org/viewcvs?rev=264506&root=gcc&view=rev Log: 2018-09-22 Thomas Koenig <tkoe...@gcc.gnu.org> PR fortran/41453 * trans.h (gfc_conv_expr_reference): Add optional argument add_clobber to prototype. (gfc_conv_procedure_call): Set add_clobber argument to gfc_conv_procedure_reference to true for scalar, INTENT(OUT), non-pointer, non-allocatable, non-dummy variables whose type is neither BT_CHARACTER, BT_DERIVED or BT_CLASS, but only if the procedure is not elemental. * trans-expr.c (gfc_conv_procedure_reference): Add clobber statement before call if add_clobber is set. 2018-09-22 Thomas Koenig <tkoe...@gcc.gnu.org> PR fortran/41453 * gfortran.dg/intent_optimize_2.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/intent_optimize_2.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-expr.c trunk/gcc/fortran/trans.h trunk/gcc/testsuite/ChangeLog