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

Problem with CLASS statement using ifort

Pierpaolo_M_
New Contributor I
378 Views

Hello,

I have a problem when testing an example program that use CLASS statement.

I am testing FORTRAN 2003 features and i have noted that this my example program does not work correctly.

I compile in this way the three attached files:

ifort -c prova.f90

ifort -c prova_sub.f90

ifort -c test_prova.f90

ifort test_prova.o prova.o prova_sub.o

and when run my executable i obtain this output:

9 16
9 16
-454078208 -454078208

I do not understand line 3.

Could someone help me to find error(s) or give me an explanation of this behaviour?

0 Kudos
2 Replies
Ron_Green
Moderator
378 Views

This is a bug in the current 11.1 compiler. There are some bugs like this related to Fortran 2003 that are to be fixed in the next major version of the compiler. This particular bug has a fix in the works, as shown below by the output of an engineering build of the compiler:

rwgreen@spdr65:~/quad/rwgreen/forums/71315> ifort -c prova.f90
rwgreen@spdr65:~/quad/rwgreen/forums/71315> ifort -c prova_sub.f90
rwgreen@spdr65:~/quad/rwgreen/forums/71315> ifort -c test_prova.f90
rwgreen@spdr65:~/quad/rwgreen/forums/71315> ifort test_prova.o prova.o prova_sub.o
rwgreen@spdr65:~/quad/rwgreen/forums/71315> ./a.out
9 16
9 16
9 16

I will check to see when this fix is due to be put into the compiler. It may not be until the next major version which is still many months away from release.

ron

0 Kudos
Pierpaolo_M_
New Contributor I
378 Views

Hi,

thanks Ron. I will wait for the next major release.

Best regards

Pierpaolo

0 Kudos
Reply