summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeanPerier <jperier@nvidia.com>2024-04-08 10:19:34 +0200
committerGitHub <noreply@github.com>2024-04-08 10:19:34 +0200
commit3c210d1cfdf4d8cd56de70fa40d01398e29044dc (patch)
tree1efd37d59b9ab873f1e33b947ff17c7b250522fa
parent8ddfb66903969224ebd4e10c1461d2be323f4798 (diff)
[flang][NFC] document BOZ error in DIM, MOD, MODULO, and SIGN (#87779)
It is highly ambiguous to what type BOZ should be resolved in DIM, MOD, MODULO, and SIGN intrinsic arguments. Some other compilers accept them, but none agree. See table below. List them explicitly as non supported extensions (semantics already reject them, this is an NFC). Table listing the resolved types of the intrinsic results when there is a BOZ argument: | | gfortran | nvfortran | ifort | nagfor | xlf | | ------------------- | -------- | --------- | ----- | ------ | ------ | | DIM(INT4, BOZ) | INT16 | INT4 | INT8 | crash | INT4 | | DIM(BOZ, REAL4) | error | INT8 | error | error | REAL4 | | DIM(REAL4, BOZ) | error | REAL4 | error | error | REAL4 | | DIM(BOZ, INT4) | INT16 | INT8 | INT8 | INT8 | INT4 | | DIM(BOZ, BOZ) | INT16 | INT8 | INT8 | INT8 | REAL4 | | MOD(INT4, BOZ) | INT16 | INT4 | INT8 | crash | INT4 | | MOD(BOZ, REAL4) | error | INT8 | error | error | REAL4 | | MOD(REAL4, BOZ) | error | REAL4 | error | error | REAL4 | | MOD(BOZ, INT4) | INT16 | INT8 | INT8 | INT8 | INT4 | | MOD(BOZ, BOZ) | INT16 | INT8 | INT8 | INT8 | INT4 | | MODULO(INT4, BOZ) | INT16 | INT4 | INT8 | crash | INT4 | | MODULO(BOZ, REAL4) | error | INT8 | error | error | REAL4 | | MODULO(REAL4, BOZ) | error | REAL4 | error | error | REAL4 | | MODULO(BOZ, INT4) | INT16 | INT8 | INT8 | INT8 | INT4 | | MODULO(BOZ, BOZ) | INT16 | INT8 | INT8 | INT8 | INT8 | | SIGN(INT4, BOZ) | error | INT4 | INT8 | INT4 | INT4 | | SIGN(BOZ, REAL4) | error | INT8 | error | error | REAL4 | | SIGN(REAL4, BOZ) | error | REAL4 | error | error | REAL4 | | SIGN(BOZ, INT4) | error | INT8 | INT8 | INT8 | INT4 | | SIGN(BOZ, BOZ) | INT16 | INT8 | INT8 | INT8 | REAL4 |
-rw-r--r--flang/docs/Extensions.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/flang/docs/Extensions.md b/flang/docs/Extensions.md
index 697bd131c04c..d44242de17d5 100644
--- a/flang/docs/Extensions.md
+++ b/flang/docs/Extensions.md
@@ -193,7 +193,9 @@ end
converted. BOZ literals are interpreted as default INTEGER only
when they appear as the first items of array constructors with no
explicit type. Otherwise, they generally cannot be used if the type would
- not be known (e.g., `IAND(X'1',X'2')`).
+ not be known (e.g., `IAND(X'1',X'2')`, or as arguments of `DIM`, `MOD`,
+ `MODULO`, and `SIGN`. Note that while other compilers may accept such usages,
+ the type resolution of such BOZ literals usages is highly non portable).
* BOZ literals can also be used as REAL values in some contexts where the
type is unambiguous, such as initializations of REAL parameters.
* EQUIVALENCE of numeric and character sequences (a ubiquitous extension),