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

Array initialization in block

Greg_Thoreson
Novice
305 Views

I found that I cannot initialize an array inside of a BLOCK statement using Intel fortran 16.0.3.207. Is this an unsupported feature, or a bug? Here's the minimal code that reproduces the error:

program testblock
    implicit none
    block
        integer, dimension(4) :: array = (/1,-1,1,-1/)
    end block
end program testblock

And here's the error message I receive:

Intel(R) Visual Fortran Compiler for applications running on IA-32, Version 16.0.3.207 Build 20160415
Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

101004_2045

catastrophic error: **Internal compiler error: internal abort** Please report this error along with the circumstances 
in which it occurred in a Software Problem Report.  Note: File and line given may not be explicit cause of this error.
compilation aborted for testblock.f90 (code 1)

 

I can easily fix it by doing this instead:

program testblock
    implicit none
    block
        integer, dimension(4) :: array
        array = (/1,-1,1,-1/)
    end block
end program testblock

But it took me a while to track down that issue and I thought others may be curious.

0 Kudos
1 Reply
Steven_L_Intel1
Employee
305 Views

It's a bug. Fixed in 17.0.

0 Kudos
Reply