https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85364

--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> If it is about variables in MAIN__ and not say variables inside of BLOCK
> inside of MAIN__, then perhaps.  For BLOCK, I wonder about stuff like:
>   !$omp parallel
>   block
>     integer :: i
>     i = ...
>     use (i)
>   end block
>   !$omp end parallel
> end
> and similar, where the implicit SAVE would be undesirable.

As far as I understand the Fortran standard, variables inside BLOCKs
are not affected.

Definition:

1.3.124
scoping unit
BLOCK construct, derived-type definition, interface body, program unit, or
subprogram, excluding all nested
scoping units in it

5.3.16 says

A variable, common block, or procedure pointer declared in the scoping unit of
a main program, module, or
submodule implicitly has the SAVE attribute, which may be confirmed by explicit
specification.

So, in your example, the variable i is unsaved.

Reply via email to