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

Today's silly code ICE

IanH
Honored Contributor III
643 Views

Slightly modified variant of the example from F95/000030.  If you add the MODULE keyword to the procedure statements inside the interface block the ICE goes away and the code compiles (the interp, which was applied to F2003, says the code is erroneous, but in F2008 the text that results from the interp has changed, so under F2008 things are ok if that change in standard text was intentional - I'll follow up on c.l.f).

  MODULE M1
    INTERFACE INT
      PROCEDURE F1, F2
    END INTERFACE
  CONTAINS
    INTEGER PURE FUNCTION F1(I)
      INTEGER :: A(INT(1_4)), B(INT(1_2))    ! A(1), B(19)
      INTEGER, PARAMETER :: KIND = SIZE(A)   ! KIND == 1
      INTEGER(KIND), INTENT(IN) :: I
      F1 = 17
    END FUNCTION F1
    
    INTEGER PURE FUNCTION F2(J)
      INTEGER :: C(INT(2_4))                 ! C(2)
      INTEGER, PARAMETER :: KIND = SIZE(C)   ! KIND == 2
      INTEGER(KIND), INTENT(IN) :: J
      F2 = 19
    END FUNCTION F2
  END MODULE M1

 

>ifort /check:all /warn:all /standard-semantics /stand "2014-10-15 spec-fun-module.f90"
Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.0.108 Build 20140726
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

2014-10-15 spec-fun-module.f90(2): internal error: Please visit 'http://www.intel.com/software/products/support' for assistance.
    INTERFACE INT
^
[ Aborting due to internal error. ]
compilation aborted for 2014-10-15 spec-fun-module.f90 (code 1)

 

0 Kudos
3 Replies
Steven_L_Intel1
Employee
643 Views

I think this is one we're already working on, but I'll make sure.

0 Kudos
Steven_L_Intel1
Employee
643 Views

Yes, this is the same as our DPD200239082. It happens when you try to extend an intrinsic function and don't use the MODULE prefix. I have added this example to the issue. Thanks.

0 Kudos
Steven_L_Intel1
Employee
643 Views

This is fixed for a release later this year.

0 Kudos
Reply