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

oneAPI ifort reporting Error 6454 on Fortran function that XE 2020 will compile

jgcappola
Beginner
1,324 Views

 

Hi all,

I am working through the compilation of the software DAMASK v2.0.3 (found here) using ifort 2021.2.0 provided within oneAPI and the compilation is failing due to the following error:

/home/<username>/code/DAMASK/src/plastic_nonlocal.f90(2409): error #6454: A recursive function name must not be used in this context.   [GETRHO]

  getRho(:,mob) = max(getRho(:,mob),0.0_pReal)

--^

which at first glance might seem reasonable since the function name in this context is also the name of the result variable which is present on both sides above. The complete function can be referenced here on GitHub at line 2383.

I have discussed this with the developers of the software and they use ifort 2019.1.2 from XE 2020 and do not see this error being reported during compilation. The developers have also built a minimal reproducible example with and without the explicit result variable statement in the function in order to test this behavior which are both attached. The compilation command are tailored to roughly match those in the makefile for DAMASK using the "-stand f08", "-standard-semantics", "-O3", and "-extend-source" flags, for example:

> ifort -stand f08 -standard-semantics -O3 -extend-source minimal_withoutresult.f90 -o minimal_wo
 

The "minimal_withoutresult" will not compile due to the error while "minimal_withresult" will compile as normal. Is it possible that this change in behavior is a compiler bug?

 

 

Labels (1)
0 Kudos
1 Solution
Barbara_P_Intel
Moderator
1,228 Views

That would be me.  Let me take a closer look.

I filed a bug report, CMPLRIL0-33952. 

A new compiler release is planned in the next few weeks.  It's not fixed in that release; I checked it just in case the issue had already been fixed.  Sometime that works... But not this time.

 

View solution in original post

0 Kudos
4 Replies
Steve_Lionel
Honored Contributor III
1,261 Views

Odd - it's -standard-semantics that triggers this.

 

D:\Projects>ifort -c minimal_withoutresult.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.2.0 Build 20210228_000000
Copyright (C) 1985-2021 Intel Corporation.  All rights reserved.

D:\Projects>

 

0 Kudos
FortranFan
Honored Contributor II
1,258 Views

@jgcappola ,

 

At first glance, your 'minimal_withoutresult.f90' appears to me to reveal a bug in Intel oneAPI version of IFORT compiler in connection with Intel Fortran team striving to implement all of Fortran 2018 standard features in oneAPI IFORT, one of which is that all - except for a few -procedures in Fortran are now recursive by default.

This change with Fortran 2018 might require /standard-semantics compiler option to come into effect, Intel team can confirm.

The implementation in IFORT appears to misunderstand the instructions in the GetRho function vis-a-vis the standard semantics with recursive functions. 

So yours is a good small reproducer case for Intel to study and evaluate with respect to the Fortran standard.  If you have support subscription, I suggest submitting an incident at:

https://supporttickets.intel.com/servicecenter?lang=en-US

 

If not, please wait for someone from Intel Fortran team to pick this up from this thread.

0 Kudos
Barbara_P_Intel
Moderator
1,229 Views

That would be me.  Let me take a closer look.

I filed a bug report, CMPLRIL0-33952. 

A new compiler release is planned in the next few weeks.  It's not fixed in that release; I checked it just in case the issue had already been fixed.  Sometime that works... But not this time.

 

0 Kudos
Barbara_P_Intel
Moderator
718 Views

This bug regarding the error message that is triggered using the -standard-semantics compiler option is fixed in the current release of ifort, 2021.8.0. It was released in December and is part of the oneAPI HPC Toolkit 2023.0.

Please check it out!



0 Kudos
Reply