Hi Steve, This looks to be OK to commit.
Thanks Paul On 3 March 2018 at 02:01, Steve Kargl <s...@troutmask.apl.washington.edu> wrote: > All, > > I would like to commit the attach patch, which fixes > a number of ICE's when simplification runs into a > size zero array. gfortran does not have a nice > easy way to determine if an array is size zero. Thus, > the new function is_size_zero_array was written after > staring at several gdb sessions. > > This patch does not fix all of the problems with > size zero arrays: > > 1) findloc isn't implemented, so obviously it's not fixed. > 2) I skipped looking at minloc and maxloc. These will take > more effort. > 3) I skipped looking at associated. There are special > conditions with size zero arrays mentioned, but I > haven't tried to cause an ICE, yet. > 4) The pad dummy argument to the spread has special condition > when she is size zero. I haven't tried to cause an > ICE, yet. > > 5) minval and maxval can take a size zero array of strings. > The requirements will call for someone with widechar > gfortran hacking experience to fix. At the moment, > gfortran will issue an error and die. So, anyone game > in handling the widechar stuff? > > 6) I haven't looked at any of the old g77 compatibility > functions. These may (or may not!) have issues. > > Regression tested on x86_64-*-freebsd. OK to commit? > > > 2018-03-02 Steven G. Kargl <ka...@gcc.gnu.org> > > PR fortran/66128 > * simplify.c (is_size_zero_array): New function to check for size > zero array. > (gfc_simplify_all, gfc_simplify_any, gfc_simplify_count, > gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity, > gfc_simplify_minval, gfc_simplify_maxval, gfc_simplify_norm2, > gfc_simplify_product, gfc_simplify_sum): Use it, and implement > requirements from F2018. > > 2018-03-02 Steven G. Kargl <ka...@gcc.gnu.org> > > PR fortran/66128 > > * gfortran.dg/zero_sized_8.f90: New test. > > > > -- > Steve -- "If you can't explain it simply, you don't understand it well enough" - Albert Einstein