[Bug fortran/83064] DO CONCURRENT inconsistent results

dominiq at lps dot ens.fr gcc-bugzilla@gcc.gnu.org
Thu Nov 23 17:30:00 GMT 2017


--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> As I said in the other bug we're seeing
>        real(real64), dimension(nsplit) :: tmp
> as "shared" amongst the outer loop iterations.
> ...
> Not sure if you need to mark compute somehow to avoid this
> and the testcase is invalid fortran or if the frontend is at fault.

IMO the testcase is valid fortran and, with my naive view of arrays returned by
a function, the returned array should be private to the function.

If I do the following changes

    real(real64), dimension(nsplit) :: pi, pik
    do concurrent (i = 1:nsplit)
        pik = compute( low(i), high(i) )
        pi(i) = sum(pik)
    end do

the code works as expected, at least for my limited testing.

Do you understand why the code is not parallelized with

More information about the Gcc-bugs mailing list