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

ICE on clash of names imported via use statement

Harald1
New Contributor II
488 Views

The following invalid code crashes current ifort/ifx:

 

 

module M1
  use, intrinsic :: ISO_C_BINDING, only: C_PTR
  use, intrinsic :: ISO_C_BINDING, only: X_PTR => C_FUNPTR
  implicit none
end module

module M2
  use M1, only: X_PTR => C_PTR ! C_PTR
  implicit none
end module

module M3
  use M1, only: C_PTR => X_PTR ! C_FUNPTR
  use M2, only: C_PTR => X_PTR ! C_PTR
  implicit none
  type(c_ptr) :: ptr
end module

 

 

I get e.g. with ifx:

 

 

% ifx ifort-use-clash.f90
ifort-use-clash.f90(13): error #6496: There is more than one use-name for a local-name.   [C_PTR]
  use M1, only: C_PTR => X_PTR ! C_FUNPTR
----------------^
ifort-use-clash.f90(17): internal error: Please visit 'http://www.intel.com/software/products/support' for assistance.
end module
^
ifort-use-clash.f90(17): catastrophic error: Internal Compiler Error: Ref module: ffe_cl.c
compilation aborted for ifort-use-clash.f90 (code 1)

 

Found while debugging a different issue...

 

Labels (1)
1 Reply
Barbara_P_Intel
Moderator
462 Views

Thanks for reporting this. The compilers shouldn't ICE even if there is a coding error. I filed CMPLRLLVM-47099 to address it.

 

 

0 Kudos
Reply