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

ICE: ifort-16.0 with -assume realloc-lhs

Wukie__Nathan
初學者
1,250 檢視

I recently upgraded to ifort 16.0 from ifort 15.0.3 for OS X and have encountered an ICE and also an unexpected segmentation fault. 

I experience the ICE when I have two derived types. The first is a component of the second. The first has an empty finalization procedure, which seems to cause the ICE. Both types have overloaded operators. 

module subtype
      implicit none
   
      type, public :: subtype_t
  
          real :: val
  
      contains
          final :: destructor
      end type subtype_t
  
  
      public operator (*)
      interface operator (*)
        module procedure op
      end interface
  
  
contains
  
      elemental function op(left,right) result(res)
          real,               intent(in)  :: left
          type(subtype_t),    intent(in)  :: right
          type(subtype_t) :: res
  
          res%val = left * right%val
  
      end function
  
      subroutine destructor(self)
          type(subtype_t),    intent(inout)   :: self

      end subroutine
  
end module


The above subtype_t is a component of a second derived type of similar structure as

module type
      use subtype
      implicit none
  
      type, public :: type_t
  
          type(subtype_t),    allocatable :: lvecs(:)
  
      end type type_t
 
      public operator (*)
      interface operator (*)
          module procedure op_two
      end interface
 
 
contains
  
 
     function op_two(left,right) result(res)
         real,               intent(in)  :: left
         type(type_t),       intent(in)  :: right
         type(type_t)    :: res
 
         res%lvecs = left * right%lvecs
 
     end function
 
end module

Trying to compile the above modules with ifort-16.0 -c -assume realloc-lhs produces an ICE. If the finalization procedure is commented out in subtype_t the code compiles without error. ifort-15.0.3 compiles in either case without error.

Assuming the finalization procedure has been commented out and the modules compile, I experience a run-time segmentation fault when testing the multiplication operator with ifort-16.0 using -assume realloc-lhs. 

program main
    use type
    implicit none

    type(type_t)    :: testing, res


    ! Allocate derived type component
    allocate(testing%lvecs(1))

    ! Assign values
    testing%lvecs(1)%val = 1.


    ! Test multiplication operation
    ! Seg-fault with ifort 16.0 using -assume realloc-lhs
    ! Executes without error using ifort 15.0.3
    res = 1. * testing


end program main

Source files are attached.

0 積分
4 回應
Wukie__Nathan
初學者
1,250 檢視

Just remembered the segmentation fault regression in 16.0 was brought up in a previous post:

https://software.intel.com/en-us/forums/topic/565017

Kevin_D_Intel
員工
1,250 檢視

Thank you Nathan. I'll look into the internal error.

Kevin_D_Intel
員工
1,250 檢視

I confirmed the ICE and escalated it to Development under the id below. I will keep you informed about a fix.

(Internal tracking id: DPD200574009)

Kevin_D_Intel
員工
1,250 檢視

Development confirmed the internal error is fixed in our current 16.0 development compiler. The fix will be present in the upcoming PSXE 2016 Update 1 next month.

回覆