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

Exception in IFX 2024.2.0 [Intel(R) 64]

andrew_4619
Honored Contributor III
443 Views

I downloaded and installed the latest compiler today and did a trial build of a reasonably large application. It did build and run OK previously on IFX but because of debugger issues we have not switched from IFORT. It now throw and exception in the debugger with the latest IFX because 'array index 1 was xxxxxxxx ( a very large number) which is bigger than the upper bound of 3'. I made a simple example shown below. This example throws an exception on line 16 but in this case gives no further information. The array index l1 = 1 and everything look fine in the debugger if you break prior to the exception. If the assignment is element by element rather than a slice it runs ok.

module mymod
   implicit none(type, external)
   integer :: ians(3,100)
   interface
        module subroutine test1()
        end subroutine test1
   end interface
end module mymod

submodule ( mymod ) mymod1
    implicit none(type, external)
    contains 
    module subroutine test1()
        integer :: l1 
        do l1 = 1 , 100
            ians(:,l1) = [ l1, l1+1, l1+2 ]
            !ians(1,l1) = l1
            !ians(2,l1) = l1+1
            !ians(3,l1) = l1+2
        enddo
    end subroutine test1
end submodule mymod1
    
program test
   use mymod, only: test1
   implicit none(type, external)
   call test1()
end program test

The compile options are:

/nologo /debug:full /Od /module:"x64\Debug\\" /object:"x64\Debug\\" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c

 

 

0 Kudos
1 Solution
Devorah_H_Intel
Moderator
298 Views

Yes, it fails in the debug config on Windows. I have escalated this report to our compiler engineering. Thank you for your report. 

View solution in original post

0 Kudos
5 Replies
andrew_4619
Honored Contributor III
396 Views

Perhaps I should have added I think this must be a compiler bug because the indexing used for a slice is outside the user control so that must be a problem in the compiler tool chain.  Additionally of one makes the arrays allocatable and allocates to the size used the problem goes away.

0 Kudos
Jellby1
New Contributor I
362 Views

I compiled on linux with

ifx -debug full -O0 -traceback -check bounds -check stack -threads a.f90

I didn't get any error when compiling or running the file.

0 Kudos
andrew_4619
Honored Contributor III
346 Views

Interesting I get:

forrtl: severe (408): fort: (11): Subscript #1 of the array IANS has value 0 which is less than the lower bound of 1

Image              PC                Routine            Line        Source
Console3.exe       00007FF7B6C611A6  TEST1                      16  ifxdebugtest.f90
Console3.exe       00007FF7B6C6128B  TEST                       27  ifxdebugtest.f90
Console3.exe       00007FF7B6C612BB  Unknown               Unknown  Unknown
Console3.exe       00007FF7B6C617C9  Unknown               Unknown  Unknown
Console3.exe       00007FF7B6C616EE  Unknown               Unknown  Unknown
Console3.exe       00007FF7B6C615AE  Unknown               Unknown  Unknown
Console3.exe       00007FF7B6C6183E  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FF9409C257D  Unknown               Unknown  Unknown
ntdll.dll          00007FF942CCAF28  Unknown               Unknown  Unknown

That is Windows which might be the difference. That is a debug build ruin in the debugger. 

0 Kudos
andrew_4619
Honored Contributor III
346 Views

It runs OK without /check:bounds it seems.  Defo feels a lot like a compiler bug.

Devorah_H_Intel
Moderator
299 Views

Yes, it fails in the debug config on Windows. I have escalated this report to our compiler engineering. Thank you for your report. 

0 Kudos
Reply