Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
27784 Discussions

ifx issue with function pointer result as lvalue (not yet supported)

Harald1
New Contributor I
365 Views

While ifort 21.3 accepts the following code, ifx-21.3 crashes:

program p
  implicit none
  integer, target  :: ptr
  integer, pointer :: A
  ptr = 42
  print *, f()
  allocate (A, stat=f())
  print *, f()
contains
  function f()
    integer, pointer :: f
    f => ptr
  end function f
end

 ifort 21.3 prints the expected:

          42
           0

 ifx-21.3 crashes with a traceback and finally:

ifx-bug-lvalue.f90(7): error #5533: Feature found on this line is not yet supported in ifx 
  allocate (A, stat=f())
--^
compilation aborted for ifx-bug-lvalue.f90 (code 3)

 

Thanks,

Harald

 

0 Kudos
1 Reply
FortranFan
Honored Contributor II
353 Views

Interested readers can see this page:

https://software.intel.com/content/www/us/en/develop/articles/fortran-language-and-openmp-features-in-ifx.html

The code in the original post makes use of a Fortran 2008 feature generally referred to "Pointer function reference is a variable" that is not supported yet by IFX. 

ifx.png

Intel Fortran team might find the code in the original post useful as a test case for IFX.

Reply