History log of /llvm-project/flang/lib/Evaluate/characteristics.cpp (Results 1 – 25 of 100)
Revision Date Author Comments
# d732c86c 27-Jan-2025 Peter Klausler <pklausler@nvidia.com>

[flang] Don't take corank from actual intrinsic argument (#124029)

When constructing the characteristics of a particular reference to an
intrinsic procedure that was passed a non-coindexed referenc

[flang] Don't take corank from actual intrinsic argument (#124029)

When constructing the characteristics of a particular reference to an
intrinsic procedure that was passed a non-coindexed reference to local
coarray data as an actual argument, don't add the corank of the actual
argument to those characteristics.

Also clean up the TypeAndShape characteristics class a little; the
Attr::Coarray is redundant since the corank() accessor can be used to
the same effect.

show more ...


# 3a8a52f4 08-Jan-2025 Peter Klausler <pklausler@nvidia.com>

[flang] Make IsCoarray() more accurate (#121415)

A designator without cosubscripts can have subscripts, component
references, substrings, &c. and still have corank. The current
IsCoarray() predica

[flang] Make IsCoarray() more accurate (#121415)

A designator without cosubscripts can have subscripts, component
references, substrings, &c. and still have corank. The current
IsCoarray() predicate only seems to work for whole variable/component
references. This was breaking some cases of THIS_IMAGE().

show more ...


# a54e8b2c 20-Nov-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Silence bogus error about insufficiently defined interfaces (#116694)

The interfaces of separate module procedures are sufficiently well
defined in a submodule to be used in a local generic

[flang] Silence bogus error about insufficiently defined interfaces (#116694)

The interfaces of separate module procedures are sufficiently well
defined in a submodule to be used in a local generic interface; the
compiler just needed to work a little harder to find them.

Fixes https://github.com/llvm/llvm-project/issues/116567.

show more ...


# 30d80009 07-Nov-2024 Valentin Clement (バレンタイン クレメン) <clementval@gmail.com>

[flang][cuda] Allow SHARED actual to DEVICE dummy (#115215)

Update the compatibility rules to allow SHARED actual argument passed to
DEVICE dummy argument. Emit a warning in that case.


# b0bdc7fc 18-Sep-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Fix subtle type naming bug in module file output (#108892)

A derived type specification in semantics holds both its source name
(for location purposes) and its ultimate derived type symbol.

[flang] Fix subtle type naming bug in module file output (#108892)

A derived type specification in semantics holds both its source name
(for location purposes) and its ultimate derived type symbol. But for
correct module file generation of a structure constructor using that
derived type spec, the original symbol may be needed so that USE
association can be exposed.

Save both the original symbol and its ultimate symbol in the
DerivedTypeSpec, and collect the right one when traversing expressions
(specifically for handling initialization in module files).

Fixes https://github.com/llvm/llvm-project/issues/108827.

show more ...


# 73cf0142 24-Jun-2024 jeanPerier <jperier@nvidia.com>

[flang] harden TypeAndShape for assumed-ranks (#96234)

SIZEOF and C_SIZEOF were broken for assumed-ranks because
`TypeAndShape::MeasureSizeInBytes` behaved as a scalar because the
`TypeAndShape::s

[flang] harden TypeAndShape for assumed-ranks (#96234)

SIZEOF and C_SIZEOF were broken for assumed-ranks because
`TypeAndShape::MeasureSizeInBytes` behaved as a scalar because the
`TypeAndShape::shape_` member was the same for scalar and assumed-ranks.

The easy fix would have been to add special handling in
`MeasureSizeInBytes` for assumed-ranks using the TypeAndShape
attributes, but I think this solution would leave `TypeAndShape::shape_`
manipulation fragile to future developers. Hence, I went for the
solution that turn shape_ into a `std::optional<Shape>`.

show more ...


# 6d2b23c4 23-May-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Fix crash in error recovery (bad binding) (#92800)

A type-bound procedure that's bound to a name that isn't a procedure is
caught as an error, but can also lead to a crash in compatibility

[flang] Fix crash in error recovery (bad binding) (#92800)

A type-bound procedure that's bound to a name that isn't a procedure is
caught as an error, but can also lead to a crash in compatibility
checking later. Make that code more robust to failure.

Fixes https://github.com/llvm/llvm-project/issues/92678.

show more ...


# 3e930864 30-Apr-2024 Valentin Clement <clementval@gmail.com>

Reland [flang][cuda] Update attribute compatibily check for unified matching rule


# 306ae14f 01-May-2024 Valentin Clement (バレンタイン クレメン) <clementval@gmail.com>

Revert "[flang][cuda] Update attribute compatibily check for unified matching rule" (#90696)

Reverts llvm/llvm-project#90679


# 86e5d6f1 01-May-2024 Valentin Clement (バレンタイン クレメン) <clementval@gmail.com>

[flang][cuda] Update attribute compatibily check for unified matching rule (#90679)

This patch updates the compatibility checks for CUDA attribute iin
preparation to implement the matching rules de

[flang][cuda] Update attribute compatibily check for unified matching rule (#90679)

This patch updates the compatibility checks for CUDA attribute iin
preparation to implement the matching rules described in section 3.2.3.
We this patch the compiler will still emit an error when there is
multiple specific procedures that matches since the matching distances
is not yet implemented. This will be done in a separate patch.


https://docs.nvidia.com/hpc-sdk/archive/24.3/compilers/cuda-fortran-prog-guide/index.html#cfref-var-attr-unified-data

gpu=unified and gpu=managed are not part of this patch since these
options are not recognized by flang yet.

show more ...


# cb263919 22-Apr-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Make proc characterization error conditional for generics (#89429)

When the characteristics of a procedure depend on a procedure that
hasn't yet been defined, the compiler currently emits a

[flang] Make proc characterization error conditional for generics (#89429)

When the characteristics of a procedure depend on a procedure that
hasn't yet been defined, the compiler currently emits an unconditional
error message. This includes the case of a procedure whose
characteristics depend, perhaps indirectly, on itself. However, in the
case where the characteristics of a procedure are needed to resolve a
generic, we should not emit an error for a hitherto undefined procedure
-- either the call will resolve to another specific procedure, in which
case the error is spurious, or it won't, and then an error will issue
anyway.

Fixes https://github.com/llvm/llvm-project/issues/88677.

show more ...


# 1c530b3d 01-Mar-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Whether a procedure's interface is explicit or not is not a d… (#82796)

…istinguishing characteristic

We note whether a procedure's interface is explicit or implicit as an
attribute of i

[flang] Whether a procedure's interface is explicit or not is not a d… (#82796)

…istinguishing characteristic

We note whether a procedure's interface is explicit or implicit as an
attribute of its characteristics, so that other semantics can be checked
appropriately, but this internal attribute should not be used as a
distinguishing characteristic in itself.

Fixes https://github.com/llvm/llvm-project/issues/81876.

show more ...


# f31ac3cb 01-Mar-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Handle implied ASYNCHRONOUS attribute (#82638)

The standard states that data objects involved in an asynchronous data
transfer statement gain the ASYNCHRONOUS attribute implicitly in the
s

[flang] Handle implied ASYNCHRONOUS attribute (#82638)

The standard states that data objects involved in an asynchronous data
transfer statement gain the ASYNCHRONOUS attribute implicitly in the
surrounding subprogram or BLOCK scope. This attribute affects the checks
in call semantics, as an ASYNCHRONOUS actual object associated with an
ASYNCHRONOUS dummy argument must not require data copies in or out.

(Most compilers don't implement implied ASYNCHRONOUS attributes
correctly; XLF gets these right, and GNU is close.)

show more ...


# 38b54c72 09-Feb-2024 Jean Perier <jperier@nvidia.com>

[flang] fix shared library builds after #81166

Fix https://lab.llvm.org/buildbot/#/builders/268/builds/7826

IsDerivedTypeWithLengthParameter cannot be used here, it would make
libFortranEvaluate de

[flang] fix shared library builds after #81166

Fix https://lab.llvm.org/buildbot/#/builders/268/builds/7826

IsDerivedTypeWithLengthParameter cannot be used here, it would make
libFortranEvaluate dependent on linFortranSemantics.
Replace by loop through parameter values.

show more ...


# b477d39b 09-Feb-2024 jeanPerier <jperier@nvidia.com>

[flang] Align runtime info and lowering regarding passing ABIs (#81166)

Runtime derived type info contains information to tell the runtime if
some argument in a user defined assignment must be pass

[flang] Align runtime info and lowering regarding passing ABIs (#81166)

Runtime derived type info contains information to tell the runtime if
some argument in a user defined assignment must be passed with a
descriptor or not. This information was not properly build, it would
tell the runtime that TARGET argument must be passed via descriptor,
which is incorrect.

Share the logic between lowering and runtime info generation to
determine if an argument must be passed by descriptor or not.

show more ...


# 3d115700 30-Jan-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Restore error status for many indistinguishable specifics (#79927)

A recent patch to allow pFUnit to compile softened the diagnostic about
indistinguishable specific procedures to a portabi

[flang] Restore error status for many indistinguishable specifics (#79927)

A recent patch to allow pFUnit to compile softened the diagnostic about
indistinguishable specific procedures to a portability warning. It turns
out that this was overkill -- for specific procedures containing no
optional or unlimited polymorphic dummy data arguments, a diagnosis of
"indistinguishable" can still be a hard error.

So adjust the analysis to be tri-state: two procedures are either
definitely distinguishable, definitely indistinguishable without
optionals or unlimited polymorphics, or indeterminate. Emit errors as
before for the definitely indistinguishable cases; continue to emit
portability warnings for the indeterminate cases.

When this patch is merged, all but one of the dozen or so tests that I
disabled in llvm-test-suite can be re-enabled.

show more ...


# 6e0a2031 15-Jan-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Catch name resolution error due to global scoping (#77683)

In
CALL FOO
PRINT *, ABS(FOO)
we currently resolve the first FOO to a global external subprogram, but
then the second F

[flang] Catch name resolution error due to global scoping (#77683)

In
CALL FOO
PRINT *, ABS(FOO)
we currently resolve the first FOO to a global external subprogram, but
then the second FOO is treated as an implicitly typed local variable.
This happens because the name FOO is not present in the local scope.

Fix by adding FOO to the local scope using a place-holding
HostAssocDetails symbol whose existence prevents the creation of another
FOO in the local scope. The symbol stored in the parser::Name parse tree
nodes or used in typed expressions will all continue to point to the
global external subprogram.

Resolves llvm-test-suite/Fortran/gfortran/regression/pr71859.f90.

show more ...


# 7b801233 15-Jan-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] More support for assumed-size Cray pointees (#77381)

Recognize Cray pointees as such when they are declared as assumed size
arrays, and don't emit a bogus error message about implied shape

[flang] More support for assumed-size Cray pointees (#77381)

Recognize Cray pointees as such when they are declared as assumed size
arrays, and don't emit a bogus error message about implied shape arrays.

Fixes https://github.com/llvm/llvm-project/issues/77330.

show more ...


# e86591b3 30-Nov-2023 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Improve procedure interface compatibility checking for dummy … (#72704)

…arrays

When comparing dummy array extents, cope with references to symbols
better (including references to other

[flang] Improve procedure interface compatibility checking for dummy … (#72704)

…arrays

When comparing dummy array extents, cope with references to symbols
better (including references to other dummy arguments), and emit
warnings in dubious cases that are not equivalent but not provably
incompatible.

show more ...


# 29fd3e2a 13-Nov-2023 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Allow polymorphic actual to implicit interface (#70873)

Semantics is emitting an error when an actual argument to a procedure
that has an implicit interface has a polymorphic type. This is

[flang] Allow polymorphic actual to implicit interface (#70873)

Semantics is emitting an error when an actual argument to a procedure
that has an implicit interface has a polymorphic type. This is too
general; while TYPE(*) and CLASS(*) unlimited polymorphic items require
the presence of an explicit procedure interface, CLASS(T) data can be
passed over an implicit interface to a procedure expecting a
corresponding dummy argument with TYPE(T), so long as T is not
parameterized.

(Only XLF handles this usage correctly among other Fortran compilers.)

(Making this work in the case of an actual CLASS(T) array may well
require additional changes in lowering to copy data to/from a temporary
buffer to ensure contiguity when the actual type of the array is an
extension of T.)

show more ...


# 11529d5b 31-Oct-2023 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Fine-tune function result equivalence checking (#70260)

When a separate module function's definition has a redundant interface
-- it's defined with MODULE FUNCTION, not MODULE PROCEDURE --

[flang] Fine-tune function result equivalence checking (#70260)

When a separate module function's definition has a redundant interface
-- it's defined with MODULE FUNCTION, not MODULE PROCEDURE -- the check
for result type equivalence needs to allow for character lengths that
are the results of specification expressions. At present,
identical-looking length specification expression don't compare equal,
since they can refer to distinct dummy argument symbols. Ensure just
that they are both constant or not, and if constant, that the lengths
have the same value.

show more ...


# c7040509 31-Oct-2023 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Reduce implicit interface compatibility warnings due to length (#69385)

When a procedure with an implicit interface is called from two call
sites with distinct argument types, we emit a war

[flang] Reduce implicit interface compatibility warnings due to length (#69385)

When a procedure with an implicit interface is called from two call
sites with distinct argument types, we emit a warning. This can lead to
a lot of output when the actual argument types are differing-length
character, and the warnings are less important since the procedure may
well have been defined with assumed-length character dummy arguments. So
let cases like CALL MYERROR('ab'); CALL MYERROR('abc') slide by without
a warning.

show more ...


# 09c544e7 27-Sep-2023 jeanPerier <jperier@nvidia.com>

[flang] Do not propagate BIND(C) from main entry to ENTRY (#67554)

15.6.2.6 point 11/12/13 tells that entries do inherit the
RECURSIVE/PURE/ELEMENTAL aspects from the main entry, but nothing as
su

[flang] Do not propagate BIND(C) from main entry to ENTRY (#67554)

15.6.2.6 point 11/12/13 tells that entries do inherit the
RECURSIVE/PURE/ELEMENTAL aspects from the main entry, but nothing as
such is said for BIND(C). It seems each entry can independently have
BIND(C) or not.

Update characterization to not propagate this info in-between entries.

Add a lowering test for a tricky case of the character return where the
return ABI is different for the result with and without BIND(C), but the
results storage should be associated regardless of the ABI.

show more ...


# f025e411 18-Sep-2023 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Accept pointer-valued function results as ASSOCIATED() arguments (#66238)

The POINTER= and TARGET= arguments to the intrinsic function
ASSOCIATED() can be the results of references to funct

[flang] Accept pointer-valued function results as ASSOCIATED() arguments (#66238)

The POINTER= and TARGET= arguments to the intrinsic function
ASSOCIATED() can be the results of references to functions that return
object pointers or procedure pointers. NULL() was working well but not
program-defined pointer-valued functions. Correct the validation of
ASSOCIATED() and extend the infrastructure used to detect and
characterize procedures and pointers.

show more ...


# 0c0b2ea9 11-Aug-2023 Peter Klausler <pklausler@nvidia.com>

[flang] Check procedure pointer initializations; clean up ELEMENTAL

Implements compatibility checking for initializers in procedure pointer
declarations. This work exposed some inconsistency in how

[flang] Check procedure pointer initializations; clean up ELEMENTAL

Implements compatibility checking for initializers in procedure pointer
declarations. This work exposed some inconsistency in how ELEMENTAL
interfaces were handled and checked, from both unrestricted intrinsic
functions and others, and some refinements needed for function result
compatbility checking; these have also been ironed out. Some new
warnings are now emitted, and this affected a dozen or so tests.

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

show more ...


1234