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

Save vs automatic surprise

sfuniroma2
Beginner
296 Views
Hi there,
I found a surprising behaviour of the IFC compiler while tracking a bug. A minimal size example:

subroutine try(n)
integer :: n

real, save :: vect(n)

vect(1) = 1.0
return
end subroutine try


This code is illegal, because array vect cannot possibily be save'd. However IFC 7.0 compiles the code by silently making array vect automatic, whereas every other compiler I tried flags this as an error. I don't know whether the language standard prescribes anything in this case, but IFC's behaviour is nonetheless surprising.
Any comments?
Thanks

Salvatore Filippone
University of Rome Tor Vergata, Rome, Italy
0 Kudos
1 Reply
Steven_L_Intel1
Employee
296 Views
I agree, this is a bug. Please report it through Intel Premier Support.

Steve
0 Kudos
Reply