Save vs automatic surprise

Save vs automatic surprise

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
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?

Salvatore Filippone
University of Rome Tor Vergata, Rome, Italy

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I agree, this is a bug. Please report it through Intel Premier Support.


Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today