[all-commits] [llvm/llvm-project] c2921d: [flang] SAVE statement should not apply to nested ...

Riccardo Bertossa via All-commits all-commits at lists.llvm.org
Sat Sep 26 12:43:02 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c2921d148e7b4e61794fa5498746ec0840861cf8
      https://github.com/llvm/llvm-project/commit/c2921d148e7b4e61794fa5498746ec0840861cf8
  Author: Riccardo Bertossa <rbertoss at sissa.it>
  Date:   2020-09-26 (Sat, 26 Sep 2020)

  Changed paths:
    M flang/lib/Evaluate/tools.cpp
    A flang/test/Semantics/save01.f90

  Log Message:
  -----------
  [flang] SAVE statement should not apply to nested scoping units

SAVE statement, according to 8.6.14, must apply to the same scoping
unit, that excludes nested scoping units. For example, if the SAVE
statement is found in a MODULE, the functions contained in that module
should not inherit the SAVE attribute. I think that the code was doing
this, failing the following source:

```
MODULE pippo
SAVE

CONTAINS
PURE FUNCTION fft_stick_index( )
   IMPLICIT NONE
   INTEGER :: fft_stick_index
   INTEGER :: mc  !error: A pure subprogram may not have a variable with the SAVE attribute
END FUNCTION

END MODULE
```

Differential Revision: https://reviews.llvm.org/D88279




More information about the All-commits mailing list