Hi Thomas, Dominique has tested this patch and so, except for a few typos that I communicated to you on #gfortran, this is good for trunk.
Somewhere, I have a list of situations where finalization is required but not yet implemented. I'll dig it out and post it on the list. Thanks Paul On 31 December 2017 at 14:48, Thomas Koenig <tkoe...@netcologne.de> wrote: > Hello world, > > the attached patch implements the simplification for minloc and maxloc. > > I had considered using the existing simplify_transformation_to_array and > simplify_transformation_to_scalar functions, but it turned out > that the special casing required for minloc/maxloc was just too > complex, so I wrote new functions (mostly copying the old ones). > > This closes a significant hole in F2003 - with this implemented, > only finalization is left as only partially implemented. > > Regression-tested. OK for trunk? > > Regards > > Thomas > > 2017-12-31 Thomas Koenig <tkoe...@gcc.gnu.org> > > PR fortran/45689 > * intrinsic.c (add_function): Add gfc_simplify_maxloc and > gfc_simplify_minloc to maxloc and minloc, respectively. > * intrinsic.h: Add prototypes for gfc_simplify_minloc > and gfc_simplify_maxloc. > * simplify.c (min_max_chose): Adjust prototype. Modify function > to have a return value which indicates if the extremum was found. > (...): Fix typo in comment. > (simplify_minmaxloc_to_scalar): New function. > (simplify_minmaxloc_nodim): New function. > (new_array): New function. > (simplify_minmaxloc_to_array): New function. > (gfc_simplify_minmaxloc): New function. > (simplify_minloc): New function. > (simplify_maxloc): New function. > > 2017-12-31 Thomas Koenig <tkoe...@gcc.gnu.org> > > PR fortran/45689 > * gfortran.dg/minloc_4.f90: New test case. > * gfortran.dg/maxloc_4.f90: New test case. -- "If you can't explain it simply, you don't understand it well enough" - Albert Einstein