diff options
author | Slava Zakharin <szakharin@nvidia.com> | 2023-03-27 19:28:36 -0700 |
---|---|---|
committer | Slava Zakharin <szakharin@nvidia.com> | 2023-03-28 10:11:47 -0700 |
commit | f9e995b4bdce7e3afbda0997b606fdc80112f803 (patch) | |
tree | ae67b138641bf2d9726b87e32953888752527f0b /flang/docs | |
parent | dbd99cfc0aacd40b6d771ca1b1fd9872390d1849 (diff) | |
download | llvm-f9e995b4bdce7e3afbda0997b606fdc80112f803.tar.gz |
[flang] Normalize logical values during type conversions.
Flang was missing value normalization for logical<->integer conversions
which is required by Flang specification. The shrinking logical<->logical
conversions were also incorrectly truncating the input.
This change performs value normalization for all logical<->integer
conversions and logical<->logical conversions between different kinds.
Note that value normalization is not strictly required for
logical(kind=k1)->logical(kind=k2) conversions when k1 < k2.
Differential Revision: https://reviews.llvm.org/D147019
Diffstat (limited to 'flang/docs')
-rw-r--r-- | flang/docs/Extensions.md | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/flang/docs/Extensions.md b/flang/docs/Extensions.md index d1b759178ac9..1e79ec4374f8 100644 --- a/flang/docs/Extensions.md +++ b/flang/docs/Extensions.md @@ -188,7 +188,9 @@ end relax enforcement of some requirements on actual arguments that must otherwise hold true for definable arguments. * Assignment of `LOGICAL` to `INTEGER` and vice versa (but not other types) is - allowed. The values are normalized. + allowed. The values are normalized to canonical `.TRUE.`/`.FALSE.`. + The values are also normalized for assignments of `LOGICAL(KIND=K1)` to + `LOGICAL(KIND=K2)`, when `K1 != K2`. * Static initialization of `LOGICAL` with `INTEGER` is allowed in `DATA` statements and object initializers. The results are *not* normalized to canonical `.TRUE.`/`.FALSE.`. |