re PR middle-end/41453 (use INTENT(out) for optimization)
authorThomas Koenig <tkoenig@gcc.gnu.org>
Sat, 22 Sep 2018 18:44:01 +0000 (18:44 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sat, 22 Sep 2018 18:44:01 +0000 (18:44 +0000)
commit056e6860b3a3f915b499a9e7be48f49da2c04850
treeefba4c14d83c1c69cafcbf03c2c2db4ab500a286
parent73a958c67e3c99e10724dc65c4cb738da6188e34
re PR middle-end/41453 (use INTENT(out) for optimization)

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.

From-SVN: r264506
gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c
gcc/fortran/trans.h
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/intent_optimize_2.f90 [new file with mode: 0644]