2018-09-22  Thomas Koenig  <tkoenig@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  <tkoenig@gcc.gnu.org>

	PR fortran/41453
	* gfortran.dg/intent_optimize_2.f90: New test.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264506 138bc75d-0d04-0410-961f-82ee72b054a4
5 files changed