Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Spurious segfault on deallocation with 14.0.2 compiler

$
0
0

When compiled with the 14.0.2 compiler, the following test code segfaults on the clearly valid DEALLOCATE statement.  This code is a variation of the example I reported in https://software.intel.com/en-us/forums/topic/516602, and reproduces the error I was originally tracking down.   Some bad object code is being generated here.

program main

  type :: T1
    integer :: dim = 0
    class(*), allocatable :: bar
  end type

  type :: T2
    type(T1), allocatable :: foo
  end type

  type(T2) :: x

  allocate(x%foo)
  x%foo%dim = x%foo%dim + 1   ! NEEDED FOR THE SEGFAULT
  print *, 'Deallocating X%FOO ...'
  deallocate(x%foo)           ! <===  CODE SEGFAULTS ON THIS STATEMENT

end program

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>