Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28446 Discussions

Pointer rank remapping rejected within FORALL

Harald1
New Contributor II
787 Views

Hello,

the following sample shows that ifort rejects pointer rank remapping within a FORALL construct. Simple pointer assignments seems to work, though.

program p
  implicit none
  type ta
     integer, pointer :: ip1(:)
     integer, pointer :: ip2(:,:)
  end type ta
  type tb
     integer, pointer :: ip2(:,:)
  end type tb
  type(ta), allocatable :: z(:)
  type(tb), allocatable :: y(:)
  integer               :: i, n1=2, n2=2
  allocate (y(10),z(10))

  do i = 1,10
     y(i)% ip2(1:n1,1:n2) => z(i)% ip1
  end do

  do, concurrent (i=1:10)
     y(i)% ip2(1:n1,1:n2) => z(i)% ip1
  end do

  forall (i=1:10)
     y(i)% ip2(1:n1,1:n2) => z(i)% ip1 ! Rejected
!    y(i)% ip2            => z(i)% ip2 ! This would be accepted
  end forall
end

 ifort 2021.7.0 gives:

ifort-forall.f90(24): error #6697: The leftside of a forall-assignment is invalid.   [IP2]
     y(i)% ip2(1:n1,1:n2) => z(i)% ip1 ! Rejected
-----------^
compilation aborted for ifort-forall.f90 (code 1)

 NAG 7.1 accepts the code without any complaint.

Thanks,

Harald

 

0 Kudos
1 Solution
Barbara_P_Intel
Moderator
728 Views

Thanks for the report. I filed a bug for you on this, CMPLRLLVM-41086. I'll post when it's fixed.


View solution in original post

0 Kudos
3 Replies
Ron_Green
Moderator
744 Views

I'll get a bug report on this one.  Thank you for sending this to us.

0 Kudos
Barbara_P_Intel
Moderator
729 Views

Thanks for the report. I filed a bug for you on this, CMPLRLLVM-41086. I'll post when it's fixed.


0 Kudos
Barbara_P_Intel
Moderator
543 Views

No more erroneous error message for this reproducer for either ifort or ifx. Try the Fortran compilers in oneAPI 2023.1 that were released this week.



0 Kudos
Reply