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

Different behavior of integer pointer and class(*) pointer with an integer target

Ben_Lauwens
Beginner
556 Views
Hello,

Following code results in an error:

program test20100518
implicit none

class(*), pointer :: first
class(*), pointer :: second
allocate (first, source = 150)
second => first
deallocate (second)
end program

source /opt/intel/Compiler/11.1/072/bin/ifortvars.sh intel64; ifort -c ../src/test/test20100518.f90
source /opt/intel/Compiler/11.1/072/bin/ifortvars.sh intel64; ifort -o ../simulator *.o
source /opt/intel/Compiler/11.1/072/bin/ifortvars.sh intel64;./../simulator
forrtl: severe (173): A pointer passed to DEALLOCATE points to an array that cannot be deallocated
Image PC Routine Line Source
simulator 000000000046D92D Unknown Unknown Unknown
simulator 000000000046C435 Unknown Unknown Unknown
simulator 0000000000441E80 Unknown Unknown Unknown
simulator 000000000042FE3A Unknown Unknown Unknown
simulator 0000000000412C80 Unknown Unknown Unknown
simulator 000000000040319B Unknown Unknown Unknown
simulator 000000000040308C Unknown Unknown Unknown
libc.so.6 00002B407E291C4D Unknown Unknown Unknown
simulator 0000000000402F89 Unknown Unknown Unknown
make[1]: *** [run] Error 173
make[1]: Leaving directory `/home/ben/synchro/Projects/FortranSim/build'
make: *** [run] Error 2

Replacing class (*) with integer allows a run without error messages.
Can this be a compiler bug?

Ben
0 Kudos
1 Reply
Steven_L_Intel1
Employee
556 Views
Yes, this is a compiler bug, but one that has already been fixed in our sources. I expect the fix to appear in Update 7, scheduled for August. The issue ID is DPD200151584.
0 Kudos
Reply