https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119460
--- Comment #1 from Paul Thomas <pault at gcc dot gnu.org> --- (In reply to Rainer Orth from comment #0) > The new gfortran.dg/reduce_1.f90 test FAILs on Solaris/SPARC and x86, both 32 > and 64-bit: > > +FAIL: gfortran.dg/reduce_1.f90 -O0 execution test > +FAIL: gfortran.dg/reduce_1.f90 -O1 execution test > +FAIL: gfortran.dg/reduce_1.f90 -O2 execution test > +FAIL: gfortran.dg/reduce_1.f90 -O3 -fomit-frame-pointer -funroll-loops > -fpeel-loops -ftracer -finline-functions execution test > +FAIL: gfortran.dg/reduce_1.f90 -O3 -g execution test > +FAIL: gfortran.dg/reduce_1.f90 -Os execution test > > Fortran runtime error: DIM in REDUCE intrinsic is less than 0 or greater > than the rank of ARRAY > > Error termination. Backtrace: Hi Rainer, This bug is due to wrong casting of 'dim'. It was caught prior to committing but I screwed up by only correcting three out of four places that needed correcting. I apologise for this and will attend to it as soon as I can - likely tonight. Thanks for the report Paul PS Do you have any use or need for reduce? In principle, the implementation could be made more efficient for intrinsic types but I am wondering if my attention is better applied elsewhere.