Commit ed5e6b8
authored
[flang] Catch calls to impure intrinsics from PURE subprograms (#160947)
The code in expression semantics that catches a call to an impure
procedure in a PURE context misses calls to impure intrinsics, since
their designators have a SpecificIntrinsic rather than a Symbol. Replace
the current check with a new one that uses the characteristics of the
called procedure, which works for both intrinsic and non-intrinsic
cases.
Testing this change revealed that an explicit INTRINSIC statement wasn't
doing the right thing for extension "dual" intrinsics that can be called
as either a function or as a subroutine; the use of an INTRINSIC
statement would disallow its use as a subroutine. I've fixed that here
as well.
Fixes #157124.1 parent 52afb8d commit ed5e6b8
File tree
5 files changed
+33
-12
lines changed- flang
- include/flang/Evaluate
- lib
- Evaluate
- Semantics
- test/Semantics
5 files changed
+33
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1674 | 1674 | | |
1675 | 1675 | | |
1676 | 1676 | | |
1677 | | - | |
| 1677 | + | |
1678 | 1678 | | |
1679 | 1679 | | |
1680 | 1680 | | |
| |||
2903 | 2903 | | |
2904 | 2904 | | |
2905 | 2905 | | |
2906 | | - | |
| 2906 | + | |
2907 | 2907 | | |
2908 | 2908 | | |
2909 | 2909 | | |
| |||
3766 | 3766 | | |
3767 | 3767 | | |
3768 | 3768 | | |
| 3769 | + | |
| 3770 | + | |
| 3771 | + | |
3769 | 3772 | | |
3770 | 3773 | | |
3771 | 3774 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3644 | 3644 | | |
3645 | 3645 | | |
3646 | 3646 | | |
| 3647 | + | |
| 3648 | + | |
| 3649 | + | |
| 3650 | + | |
| 3651 | + | |
| 3652 | + | |
| 3653 | + | |
| 3654 | + | |
| 3655 | + | |
| 3656 | + | |
| 3657 | + | |
| 3658 | + | |
| 3659 | + | |
| 3660 | + | |
3647 | 3661 | | |
3648 | 3662 | | |
3649 | 3663 | | |
3650 | 3664 | | |
3651 | | - | |
3652 | | - | |
3653 | | - | |
3654 | | - | |
3655 | | - | |
3656 | | - | |
3657 | | - | |
3658 | | - | |
3659 | | - | |
3660 | 3665 | | |
3661 | 3666 | | |
3662 | 3667 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5726 | 5726 | | |
5727 | 5727 | | |
5728 | 5728 | | |
5729 | | - | |
| 5729 | + | |
| 5730 | + | |
5730 | 5731 | | |
5731 | 5732 | | |
5732 | 5733 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments