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

14.0.2 compiler bug: ALLOCATED returns the incorrect result

$
0
0

When the following test case is compiled with the 14.0.2 compiler, the executable returns T for the allocation status of  X%FOO when it is clearly not allocated.

program main

  type :: T1
    class(*), allocatable :: bar
  end type

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

  type(T2) :: x

  allocate(x%foo)
  deallocate(x%foo)
  print *, allocated(x%foo), ' (expect F)'  ! GIVES THE WRONG RESULT

end program

I've also attached the code for convenience.   The underlying cause of the problem may in fact be the same as for DPD200249493 which I reported last October.  The two examples are very similar but not identical.  I only recognized their similarities after spending several hours stripping a wad of actual code back to this example.  There was a workaround in that case, which involved nullifying a pointer;  is there a workaround in this case?  

AttachmentSize
Downloadintel-bug-20140618a.f90691 bytes

Viewing all articles
Browse latest Browse all 3270

Trending Articles



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