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.

Reply via email to