[Bug fortran/68769] [fortran] annotate omp data pointers with restrict for -fno-cray-pointers
vries at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 21 14:08:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68769
vries at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution|--- |INVALID
--- Comment #2 from vries at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #1)
> > Without pointers, there's no way to introduce an alias for a and b.
>
> Indeed! but I don't understand what cray pointers have to do with that. They
> are an extension to f77 which is rejected by gfortran unless -fcray-pointer
> is used
I was looking around for something 'pointery' in fortran, and fcray-pointer is
what I found.
> Note that in post f90 standards, POINTERs are part of the Fortran syntax and
> can alias.
I see, that's good to know.
Indeed, with this program, I can introduce aliasing:
...
program main
implicit none
integer, parameter :: n = 1024
integer :: i
integer, target :: a(n)
integer, pointer :: b(:)
b => a
i = 0
do i = 0, n - 1
a(i) = i * 2
end do
!$omp parallel do
do i = 1, n
a(i) = b(i) + b(i)
end do
do i = 0, n - 1
if (a(i) .ne. i * 4) call abort
end do
end program main
...
Marking resolved-invalid.
More information about the Gcc-bugs
mailing list