Hello world,

another obvious and simple one-line fix for fallout from the INTENT(OUT)
clobber patch.  Committed as r264539, after regression-testing.

It seems our testsuite is not testing as many combinations in the
language as I thought :-)

Regards

        Thomas

2018-09-24  Thomas Koenig  <tkoe...@gcc.gnu.org>

        PR fortran/87397
        * gfc_conv_procedure_call: Do not add clobber on INTENT(OUT)
        for variables in an associate statement.

2018-09-24  Thomas Koenig  <tkoe...@gcc.gnu.org>

        PR fortran/87401
        * gfortran.dg/intent_out_12.f90: New test.
Index: trans-expr.c
===================================================================
--- trans-expr.c	(Revision 264538)
+++ trans-expr.c	(Arbeitskopie)
@@ -5282,6 +5282,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol *
 			&& !e->symtree->n.sym->attr.dummy
 			/* FIXME - PR 87395 and PR 41453  */
 			&& e->symtree->n.sym->attr.save == SAVE_NONE 
+			&& !e->symtree->n.sym->attr.associate_var
 			&& e->ts.type != BT_CHARACTER && e->ts.type != BT_DERIVED
 			&& e->ts.type != BT_CLASS && !sym->attr.elemental;
 
! { dg-do  run }
! PR fortran/87401 - this used to segfault at runtime.
! Test case by Janus Weil.

program assoc_intent_out

   implicit none

   real :: r

   associate(o => r)
      call sub(o)
   end associate

contains

   subroutine sub(out)
      real, intent(out) :: out
      out = 0.0
   end subroutine

end

Reply via email to