Hi Thomas, You didn't attach the testcase but never mind, I am sure that it is OK :-)
OK for trunk and, if you feel like it, for 9-branch. Thanks Paul On Tue, 21 Apr 2020 at 22:56, Thomas Koenig via Fortran <fort...@gcc.gnu.org> wrote: > Hello world, > > this one took a bit of detective work. When array pointers point > to components of derived types, we currently set the span field > and then create an array temporary when we pass the array > pointer to a procedure as a non-pointer or non-target argument. > (This is inefficient, but that's for another release). > > Now, the compiler detected this case when there was a direct assignment > like p => a%b, but not when p was returned either as a function result > or via an argument. This patch fixes that. > > Regression-tested. OK for trunk, gcc 9 and gcc8 (all are affected)? > > Regards > > Thomas > > 2020-04-21 Thomas Koenig <tkoe...@gcc.gnu.org> > > PR fortran/93956 > * expr.c (gfc_check_pointer_assign): Also set subref_array_pointer > when a function returns a pointer. > * interface.c (gfc_set_subref_array_pointer_arg): New function. > (gfc_procedure_use): Call it. > > 2020-04-21 Thomas Koenig <tkoe...@gcc.gnu.org> > > PR fortran/93956 > * gfortran.dg/pointer_assign_13.f90: New test. > -- "If you can't explain it simply, you don't understand it well enough" - Albert Einstein