History log of /llvm-project/flang/lib/Semantics/expression.cpp (Results 1 – 25 of 238)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7
# 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 ...


# 7453d764 08-Jan-2025 Peter Klausler <pklausler@nvidia.com>

[flang] Silence inappropriate error message (#120614)

A recent patch added better compatibility checking for actual procedure
arguments, but it has led to a few failures in the Fujitsu Fortran test

[flang] Silence inappropriate error message (#120614)

A recent patch added better compatibility checking for actual procedure
arguments, but it has led to a few failures in the Fujitsu Fortran test
suite in cases of NULL() actual arguments being associated with dummy
procedure pointers. As is the case with dummy data pointers, these must
always be accepted.

Fixes Fujitsu Fortran test cases 0249_0023 through 0028 and 0387_0047.

show more ...


# fc97d2e6 18-Dec-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Add UNSIGNED (#113504)

Implement the UNSIGNED extension type and operations under control of a
language feature flag (-funsigned).

This is nearly identical to the UNSIGNED feature that h

[flang] Add UNSIGNED (#113504)

Implement the UNSIGNED extension type and operations under control of a
language feature flag (-funsigned).

This is nearly identical to the UNSIGNED feature that has been available
in Sun Fortran for years, and now implemented in GNU Fortran for
gfortran 15, and proposed for ISO standardization in J3/24-116.txt.

See the new documentation for details; but in short, this is C's
unsigned type, with guaranteed modular arithmetic for +, -, and *, and
the related transformational intrinsic functions SUM & al.

show more ...


# b2c363e2 17-Dec-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Fix generic resolution with actual/dummy procedure incompatib… (#120105)

…ility

We generally allow any legal procedure pointer target as an actual
argument for association with a dummy p

[flang] Fix generic resolution with actual/dummy procedure incompatib… (#120105)

…ility

We generally allow any legal procedure pointer target as an actual
argument for association with a dummy procedure, since many actual
procedures are underspecified EXTERNALs. But for proper generic
resolution, it is necessary to disallow incompatible functions with
explicit result types.

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

show more ...


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5
# 6baf0023 02-Dec-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Downgrade recently added error to a warning (#117217)

An empty array shouldn't be subscripted, but sometimes they are in
zero-trip loops in real applications. So change a recently added err

[flang] Downgrade recently added error to a warning (#117217)

An empty array shouldn't be subscripted, but sometimes they are in
zero-trip loops in real applications. So change a recently added error
message to a warning (off by default).

show more ...


Revision tags: llvmorg-19.1.4
# fe5a64d1 08-Nov-2024 Valentin Clement (バレンタイン クレメン) <clementval@gmail.com>

[fang][cuda] Allow * in call chevron syntax (#115381)

Using `*` in call chevron syntax should be allowed. This patch updates
the parser to allow this usage.

```
call sub<<<*,nbBlock>>>()
```


Revision tags: llvmorg-19.1.3, llvmorg-19.1.2
# 0f973ac7 02-Oct-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Tag warnings with LanguageFeature or UsageWarning (#110304)

(This is a big patch, but it's nearly an NFC. No test results have
changed and all Fortran tests in the LLVM test suites work as

[flang] Tag warnings with LanguageFeature or UsageWarning (#110304)

(This is a big patch, but it's nearly an NFC. No test results have
changed and all Fortran tests in the LLVM test suites work as expected.)

Allow a parser::Message for a warning to be marked with the
common::LanguageFeature or common::UsageWarning that controls it. This
will allow a later patch to add hooks whereby a driver will be able to
decorate warning messages with the names of its options that enable each
particular warning, and to add hooks whereby a driver can map those
enumerators by name to command-line options that enable/disable the
language feature and enable/disable the messages.

The default settings in the constructor for LanguageFeatureControl were
moved from its header file into its C++ source file.

Hooks for a driver to use to map the name of a feature or warning to its
enumerator were also added.

To simplify the tagging of warnings with their corresponding language
feature or usage warning, to ensure that they are properly controlled by
ShouldWarn(), and to ensure that warnings never issue at code sites in
module files, two new Warn() member function templates were added to
SemanticsContext and other contextual frameworks. Warn() can't be used
before source locations can be mapped to scopes, but the bulk of
existing code blocks testing ShouldWarn() and FindModuleFile() before
calling Say() were convertible into calls to Warn(). The ones that were
not convertible were extended with explicit calls to
Message::set_languageFeature() and set_usageWarning().

show more ...


# 856c38d5 02-Oct-2024 David Truby <david.truby@arm.com>

[flang] Implement GETUID and GETGID intrinsics (#110679)

GETUID and GETGID are non-standard intrinsics supported by a number of
other Fortran compilers. On supported platforms these intrinsics simp

[flang] Implement GETUID and GETGID intrinsics (#110679)

GETUID and GETGID are non-standard intrinsics supported by a number of
other Fortran compilers. On supported platforms these intrinsics simply
call the POSIX getuid() and getgid() functions and return the result.
The only platform we support that does not have these is Windows.

Windows does not have the same concept of UIDs and GIDs, so on Windows
we issue a warning indicating this and return 1 from both functions.

Co-authored-by: Yi Wu <yi.wu2@arm.com>

show more ...


Revision tags: llvmorg-19.1.1
# 7a0a7947 30-Sep-2024 David Truby <david.truby@arm.com>

Revert "[flang] Implement GETUID and GETGID intrinsics" (#110531)

Reverts llvm/llvm-project#108017


# 054eadcb 30-Sep-2024 David Truby <david.truby@arm.com>

[flang] Implement GETUID and GETGID intrinsics (#108017)

GETUID and GETGID are non-standard intrinsics supported by a number of
other Fortran compilers. On supported platforms these intrinsics simp

[flang] Implement GETUID and GETGID intrinsics (#108017)

GETUID and GETGID are non-standard intrinsics supported by a number of
other Fortran compilers. On supported platforms these intrinsics simply
call the POSIX getuid() and getgid() functions and return the result.
The only platform we support that does not have these is Windows.

Windows does not have the same concept of UIDs and GIDs, so on Windows
we issue a warning indicating this and return 1 from both functions.

Co-authored-by: Yi Wu <yi.wu2@arm.com>

---------

Co-authored-by: Yi Wu <yi.wu2@arm.com>

show more ...


# d5dd7d23 17-Sep-2024 Youngsuk Kim <youngsuk.kim@hpe.com>

[flang] Tidy uses of raw_string_ostream (NFC)

As specified in the docs,
1) raw_string_ostream is always unbuffered and
2) the underlying buffer may be used directly

( 65b13610a5226b84889b923bae884b

[flang] Tidy uses of raw_string_ostream (NFC)

As specified in the docs,
1) raw_string_ostream is always unbuffered and
2) the underlying buffer may be used directly

( 65b13610a5226b84889b923bae884ba395ad084d for further reference )

Avoid unneeded calls to raw_string_ostream::str(), to avoid excess indirection.

show more ...


Revision tags: llvmorg-19.1.0
# 52420188 12-Sep-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Catch attempts to subscribe empty arrays (#108246)

An array that has one or more empty dimensions cannot have subscripts
unless there's a possibility that they constitute an empty array
se

[flang] Catch attempts to subscribe empty arrays (#108246)

An array that has one or more empty dimensions cannot have subscripts
unless there's a possibility that they constitute an empty array
section.

We previously only checked that constant subscripts are in bounds.

show more ...


# 108ed9d9 11-Sep-2024 Abid Qadeer <haqadeer@amd.com>

[flang] Remove a leftover debugging message. (#108175)


# 050f785e 11-Sep-2024 Philip Reames <preames@rivosinc.com>

Revert "[flang][runtime] Fix odd "invalid descriptor" runtime crash (#107785)"

This reverts commit 15106c26662a573df31e8dfdd9350c313b8bfd84. Commit does
not pass check-flang on x86 host.


# d418a03e 10-Sep-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Fix error from semantics on use associated procedure pointer (#107928)

Use associated procedure pointers were eliciting bogus errors from
semantics if their modules also contained generic p

[flang] Fix error from semantics on use associated procedure pointer (#107928)

Use associated procedure pointers were eliciting bogus errors from
semantics if their modules also contained generic procedure interfaces
of the same name. (The compiler handles this case correctly when the
specific procedure of the same name is not a pointer.)

With this fix, the test case in
https://github.com/llvm/llvm-project/issues/107784
no longer experiences semantic errors; however, it now crashes
unexpectedly in lowering.

show more ...


# 15106c26 10-Sep-2024 Peter Klausler <pklausler@nvidia.com>

[flang][runtime] Fix odd "invalid descriptor" runtime crash (#107785)

A defined assignment generic interface for a given LHS/RHS type & rank
combination may have a specific procedure with LHS dummy

[flang][runtime] Fix odd "invalid descriptor" runtime crash (#107785)

A defined assignment generic interface for a given LHS/RHS type & rank
combination may have a specific procedure with LHS dummy argument that
is neither allocatable nor pointer, or specific procedure(s) whose LHS
dummy arguments are allocatable or pointer. It is possible to have two
specific procedures if one's LHS dummy argument is allocatable and the
other's is pointer.

However, the runtime doesn't work with LHS dummy arguments that are
allocatable, and will crash with a mysterious "invalid descriptor" error
message.

Extend the list of special bindings to include
ScalarAllocatableAssignment and ScalarPointerAssignment, use them when
appropriate in the runtime type information tables, and handle them in
Assign() in the runtime support library.

show more ...


# ce392471 10-Sep-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Silence spurious error on non-CUDA use of CUDA module (#107444)

When a module file has been compiled with CUDA enabled, don't emit
spurious errors about non-interoperable types when that mo

[flang] Silence spurious error on non-CUDA use of CUDA module (#107444)

When a module file has been compiled with CUDA enabled, don't emit
spurious errors about non-interoperable types when that module is read
by a USE statement in a later non-CUDA compilation.

show more ...


# 3f1d0e1b 05-Sep-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Silence warning in module file (#107421)

Most warnings should be silenced when processing the content of a module
file, since the warning should have also appeared when the module file
was

[flang] Silence warning in module file (#107421)

Most warnings should be silenced when processing the content of a module
file, since the warning should have also appeared when the module file
was generated. The case of an intrinsic type kind not being supported
for a target wasn't being suppressed; fix.

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

show more ...


# d1e4a2d3 04-Sep-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Fix spurious error with separate module procedures (#106768)

When the implementation of one SMP apparently references another in what
might be a specification expression, semantics may need

[flang] Fix spurious error with separate module procedures (#106768)

When the implementation of one SMP apparently references another in what
might be a specification expression, semantics may need to resolve it as
a forward reference, and to allow for the replacement of a
SubprogramNameDetails place-holding symbol with the final
SubprogramDetails symbol. Otherwise, as in the bug report below,
confusing error messages may result.

(The reference in question isn't really in the specification part of a
subprogram, but due to the syntactic ambiguity between the array element
assignment statement and a statement function definition, it appears to
be so at the time that the reference is processed.)

I needed to make DumpSymbols() available via SemanticsContext to analyze
this bug, and left that new API in place to make things easier next
time.

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

show more ...


Revision tags: llvmorg-19.1.0-rc4
# 10cc4a5f 20-Aug-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] More support for anonymous parent components in struct constr… (#102642)

…uctors

A non-conforming extension to Fortran present in a couple other
compilers is allowing a anonymous compone

[flang] More support for anonymous parent components in struct constr… (#102642)

…uctors

A non-conforming extension to Fortran present in a couple other
compilers is allowing a anonymous component in a structure constructor
to initialize a parent (or greater ancestor) component. This was working
in this compiler only for direct parents, and only when the type was not
use-associated.

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

show more ...


Revision tags: llvmorg-19.1.0-rc3
# 245eb0a7 08-Aug-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Catch structure constructor in its own type definition (#102241)

The check for a structure constructor to a forward-referenced derived
type wasn't tripping for constructors in the type defi

[flang] Catch structure constructor in its own type definition (#102241)

The check for a structure constructor to a forward-referenced derived
type wasn't tripping for constructors in the type definition itself. Set
the forward reference flag unconditionally at the beginning of name
resolution for the type definition.

show more ...


Revision tags: llvmorg-19.1.0-rc2
# ca305337 02-Aug-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Fix -fdefault-integer-8 result kind of relations (#101234)

The result of a relational operator is a default logical, which is
LOGICAL(8) under the -fdefault-integer-8 option.

Fixes https

[flang] Fix -fdefault-integer-8 result kind of relations (#101234)

The result of a relational operator is a default logical, which is
LOGICAL(8) under the -fdefault-integer-8 option.

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

show more ...


Revision tags: llvmorg-19.1.0-rc1, llvmorg-20-init
# 6c09a9bf 18-Jul-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Check assignment conformance for derived types (#99059)

Derived type assignment checking needs to account for the possibility of
derived assignment. The implementation was checking compile-

[flang] Check assignment conformance for derived types (#99059)

Derived type assignment checking needs to account for the possibility of
derived assignment. The implementation was checking compile-time
conformance errors only on the path for assignments of intrinsic types.
Add a static array conformance check in the derived type flow once it
has been established that no defined assignment exists.

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

show more ...


# 7f06560e 12-Jul-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Re-land PR#97337 (#98656)

Pull request https://github.com/llvm/llvm-project/pull/97337 was
reverted by https://github.com/llvm/llvm-project/pull/98612 due
to two failing tests in llvm-test

[flang] Re-land PR#97337 (#98656)

Pull request https://github.com/llvm/llvm-project/pull/97337 was
reverted by https://github.com/llvm/llvm-project/pull/98612 due
to two failing tests in llvm-test-suite -- which I ran, as always,
but must have bungled or misinterpreted (mea culpa).

The failing tests were llvm-test-suite/Fortran/gfortran/regression/
char_length_{20,21}.f90. They have array constructors with
explicit character types whose dynamic length values are negative
at runtime, which must be interpreted as zero.

This patch extends the original to cover those cases.

show more ...


# 3b362ee7 12-Jul-2024 David Spickett <david.spickett@linaro.org>

Revert "[flang] Adjust semantics of the char length of an array constructor" (#98612)

Reverts llvm/llvm-project#97337

This has caused llvm test suite failures on our bots, for example:
https://l

Revert "[flang] Adjust semantics of the char length of an array constructor" (#98612)

Reverts llvm/llvm-project#97337

This has caused llvm test suite failures on our bots, for example:
https://lab.llvm.org/buildbot/#/builders/17/builds/709

```
FAIL: test-suite::gfortran-regression-execute-regression__char_length_21_f90.test
FAIL: test-suite::gfortran-regression-execute-regression__char_length_20_f90.test
```

show more ...


12345678910