On Mon, Apr 9, 2018 at 10:58 PM, Thomas Koenig <tkoe...@netcologne.de> wrote: > Hi Steve, > >> On Mon, Apr 09, 2018 at 10:10:13PM +0200, Thomas Koenig wrote: >>> >>> >>> the attached patch removes the parallel annotation from DO CONCURRENT. >>> As discussed in the PR, the autoparallellizer currently generates >>> wrong code. The only feasible way is to disable the annotation for >>> gcc-8 and work on the wrong-code issues for gcc-9. This is an 8 >>> regression. >>> >>> Regression-tested. OK for trunk? >>> >> >> Yes. > > > Thanks for the review! > > However, just as I was about to commit, I thought of something else > and, hopefully, better. > > The underlying problem is that the annotation does not go together > with -ftree-parallelize-loops - so let's simply not set it if that > flag is set. > > This way, we can avoid speed regressions for people who do not use > -ftree-parallelize-loops, and it will be possible to downgrade the > PR to a missed-optimization bug; it is also not necessary to xfail > vect-do-concurrent-1.f90 > > Regression-tested. OK for trunk, for this version?
flag_tree_parallelize_loops is 1 by default (and doesn't parallelize then, the flag specifies the number of threads). The pass is also run if flag_openacc. Note that setting the attribute is only ever useful for autopar, nothing else looks at it. I think before I made the change there was the ivdep flag set which should be still valid (in fact lowering of parallel_kind sets both can_be_parallel and safelen). So I suggest to instead unconditonally replace parallel_kind with ivdep_kind. Richard. > > 2018-04-09 Thomas Koenig <tkoe...@gcc.gnu.org> > > PR fortran/83064 > * trans-stmt.c (gfc_trans_forall_loop): Remove annotation for > parallell processing of DO CONCURRENT -ftree-parallelize-loops > is set. > > 2018-04-09 Thomas Koenig <tkoe...@gcc.gnu.org> > > PR fortran/83064 > * gfortran.dg/do_concurrent_5.f90: New test. > * gfortran.dg/vect/vect-do-concurrent-1.f90: Adjust dg-bogus > message.