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

Fatal regression in Intel oneAPI, maybe in 2022 or 2023

Juergen_R_R
Valued Contributor II
799 Views

Intel oneAPI erroneously flags the following code (cf. below) with the follwing error code:

qedtest_1_lib.f90(195): error #8284: If the actual argument is scalar, the dummy argument shall be scalar unless the actual argument is of type character or is an element of an array that is not assumed shape, pointer, or polymorphic. [MD5SUM_TMP]
call copy (qedtest_1_lib_md5sum ())

 

I believe that this code is correct (it is an character array!!), and it compile with Intel 2021 and earlier, with gfortran, NAG and nvidia.

! Return the MD5 sum for the process configuration (as a C pointer to a character array)
subroutine qedtest_1_lib_get_md5sum_ptr (i, cptr, len) bind(C)
  use iso_c_binding
  use opr_qedtest_1_p1_i1, only: qedtest_1_p1_i1_md5sum => md5sum
  implicit none
  interface
     function qedtest_1_lib_md5sum () result (md5sum)
       character(32) :: md5sum
     end function qedtest_1_lib_md5sum
  end interface
  integer(c_int), intent(in) :: i
  type(c_ptr), intent(out) :: cptr
  integer(c_int), intent(out) :: len
  character(kind=c_char), dimension(32), target, save :: md5sum
  select case (i)
  case (0)
     call copy (qedtest_1_lib_md5sum ())
     cptr = c_loc (md5sum)
  case (1)
     call copy (qedtest_1_p1_i1_md5sum ())
     cptr = c_loc (md5sum)
  case default
     cptr = c_null_ptr
  end select
  len = 32
contains
  subroutine copy (md5sum_tmp)
    character, dimension(32), intent(in) :: md5sum_tmp
    md5sum = md5sum_tmp
  end subroutine copy
end subroutine qedtest_1_lib_get_md5sum_ptr

 

0 Kudos
1 Solution
Alina_S_Intel
Employee
569 Views

The issue is fixed in 2023.2 compiler


View solution in original post

0 Kudos
2 Replies
Juergen_R_R
Valued Contributor II
774 Views

Somebody opened a support request, thanks for that!

 

Actually, putting the function call into parenthesis and forcing its exectution serves as a workaround:

 select case (i)
  case (0)
     call copy ((template_me_1_lib_md5sum ()))
     cptr = c_loc (md5sum)
  case (1)
     call copy ((template_me_1_p1_i1_md5sum ()))
     cptr = c_loc (md5sum)
  case default
     cptr = c_null_ptr
  end select
0 Kudos
Alina_S_Intel
Employee
570 Views

The issue is fixed in 2023.2 compiler


0 Kudos
Reply