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

Conflict with intrinsic Intel extension

Espen_M_
Beginner
727 Views

I want to have a generic function called AND taking various kinds and numbers of arguments. The functions and the generic interface are placed in module(s). When trying to compile I get the following error message:

internal error: Please visit 'http://www.intel.com/software/products/support' for assistance

I found this very strange until I found that the same happens with an analogue OR function. There is no entry for AND in the documentation (integrated with VS), and I got no hits when searching for 'and', but there is an entry for OR (without the green colored font, but with a reference to the standart intrinsic IOR). When checking IAND I see (in green writing) that it is an Intel extension to be able to use AND as an alias for the standard IAND. As I guess that this is the root to my problem; it possible to 'turn off' Intel procedure aliases?

PS: if, instead of placing the functions and interface in a module, I place them in a PROGRAM it compiles...

0 Kudos
9 Replies
TimP
Honored Contributor III
727 Views
If your AND function is declared with explicit interface, or even with EXTERNAL, this would "turn off" the legacy extension of AND() as an intrinsic. Regardless, an internal error report is evidence of a compiler bug, and, if produced by a current compiler release, should be reported with a test case to reproduce it.
0 Kudos
Espen_M_
Beginner
727 Views
[fortran] MODULE test INTERFACE and PROCEDURE and_gen END INTERFACE and INTEGER,PARAMETER :: log_gen = KIND(.true.) CONTAINS ELEMENTAL FUNCTION and_gen(log1,log2) RESULT(res) IMPLICIT NONE LOGICAL(log_gen),INTENT(IN) :: log1,log2 LOGICAL(log_gen) :: res IF(log1) THEN IF (log2) THEN res = .TRUE. RETURN END IF END IF res = .FALSE. END FUNCTION and_gen END MODULE [/fortran]
0 Kudos
mecej4
Honored Contributor III
727 Views
I can see the ICE when I try to compile the module source given in #2 with the current Windows 32-bit compiler (13.0.1.119). If the interface name is changed to something else, e.g., MyAnd, the ICE goes away.
0 Kudos
Steven_L_Intel1
Employee
727 Views
Thanks - we'[ll take a look.
0 Kudos
Espen_M_
Beginner
727 Views
Nevertheless, for now, is it possible to switch off all non-standard functions?
0 Kudos
Steven_L_Intel1
Employee
727 Views
No, it is not. Use of EXTERNAL is the proper way to declare that specific functions are not intrinsic. The real problem here is that we apparently did not do a perfect job of allowing the MODULE keyword in MODULE PROCEDURE to be omitted. If you insert that keyword in the interface (MODULE PROCEDURE and_gen) it works. I will escalate this to the developers. Issue ID is DPD200239082.
0 Kudos
Espen_M_
Beginner
727 Views
Ok, inserting the MODULE keyword surely did the trick! But will I have to use the EXTERNAL keyword everytime I want to use these functions even though they are available through USE association?
0 Kudos
Steven_L_Intel1
Employee
727 Views
The language doesn't really give a way to undefine an intrinsic in the context of a generic interface. You're allowed to override the intrinsic with your own definition where the arguments match the intrinsic if you want. You don't need to use EXTERNAL in this case.
0 Kudos
Steven_L_Intel1
Employee
727 Views

This is fixed for a release later this year.

0 Kudos
Reply