On 20 November 2017 at 15:45, Steve Kargl <s...@troutmask.apl.washington.edu> wrote: > On Mon, Nov 20, 2017 at 12:57:47PM +0100, Bernhard Reutner-Fischer wrote: >> On 20 November 2017 at 12:26, Eric Botcazou <ebotca...@adacore.com> wrote: >> >> If anybody finds the time to push the corresponding Fortran changes then >> >> I'd >> >> be grateful. I won't have time for this until end of stage 1... >> >> >> >> https://gcc.gnu.org/ml/fortran/2015-02/msg00014.html >> > >> > OK, I'm going to merge it in the main patch. >> >> [CCing fortran@] >> Thanks alot in advance! > > The URL points to a nearly 3 year old patch. I noticed > that there is no documentation of the new Fortran directive. > Section 7.2 of gfortran.info should be updated. In particular, > does '!GCC$ UNROLL 4' affect only the immediately following > DO-LOOP or all DO-LOOPs that follow the directive until another > 'GCC$ UNROLL ...' is found? How does this new directive interface > with OpenMP and OpenACC?
The documentation for the directive is missing indeed. We can fix this during stage3. Currently the directive works on the whole function (see gfc_cfun_has_unroll()) and instructs the loop-optimizers to run on that function. The loop-optimizers will discover the ANNOTATE_EXPR and act accordingly. Richard B. already noted that the RTL unroller might do more than intended, see https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01468.html I expect updates to the C and C++ in this area to be reflected to Fortran too. The interaction with OpenMP and OpenACC in the Fortran FE is the same as in the other frontends, obviously. Eric's current respin of Mikes patch is here, FYI: https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01452.html thanks,