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

ifort frontend bug

Eric_K_7
Beginner
336 Views

All,

The ifort (and presumably ifx) parser stumbles upon the identifier CLASSIFY in the following example:

module ifort_bug
type mytype
   integer:: value=1
contains
   procedure classify
end type mytype
contains
!-------------
subroutine classify(t,iout)
class(mytype),intent(in):: t
integer,intent(out):: iout
iout=t%value
return
end subroutine classify
!-------------
end module ifort_bug

Running version 2021.6.0  as ifort -c bug.f:

bug.f(5): error #5082: Syntax error, found 'IF' when expecting one of: , <END-OF-STATEMENT> ; =>
procedure classify
-----------------^
bug.f(5): error #8169: The specified interface is not declared. [CLASS]
procedure classify
------------^
bug.f(5): error #8169: The specified interface is not declared. [Y]
procedure classify
-------------------^
compilation aborted for bug.f (code 1)

Renaming to KLASSIFY avoids the error, but still, it's a bug.

Thanks,

--Eric

0 Kudos
1 Solution
Shiquan_Su
Employee
188 Views


The fix will be included in the next OneAPI release, which is typically within 3 months. Thank you.


View solution in original post

3 Replies
Ron_Green
Moderator
308 Views

Hi Eric,

 

Yes, it's a bug in the fixed source form parsing.  I created your example as a fixed source form file 'repro.f'. 

I discovered that if you rename this file from ".f" to ".f90" so the compiler treats it as a free source form there is no issue.

 

We have had a couple of such fixed source form parsing errors in the past year.  I'll write up a bug report.  Thanks for sending this to us.  My 2 samples attached.

 

Shiquan_Su
Employee
250 Views

The test code provided by Ron has reproduced the desired bug. The bug has been reported to the proper channel to proceed further. We will keep posting updates here.

Shiquan_Su
Employee
189 Views


The fix will be included in the next OneAPI release, which is typically within 3 months. Thank you.


Reply