OSDN Git Service

[flang] Fix bogus message on internal subprogram with alternate return
authorPeter Steinfeld <psteinfeld@nvidia.com>
Mon, 4 Jan 2021 17:35:15 +0000 (09:35 -0800)
committerPeter Steinfeld <psteinfeld@nvidia.com>
Fri, 8 Jan 2021 18:14:21 +0000 (10:14 -0800)
commitae0d1d2e5cd3a99da0b2eefc27c8f94b95f03cc6
tree9a63c5970ebac51a67c4a6138bcffe1035aa90bb
parent311b247c9fb58ee476184a7eb8044b8f54f95035
[flang] Fix bogus message on internal subprogram with alternate return

Internal subprograms have explicit interfaces.  If an internal subprogram has
an alternate return, we check its explicit interface.  But we were not
putting the label values of alternate returns into the actual argument.

I fixed this by changing the definition of actual arguments to be able
to contain a common::Label and putting the label for an alternate return
into the actual argument.

I also verified that we were already doing all of the semantic checking
required for alternate returns and removed a "TODO" for this.

I also added the test altreturn06.f90.

Differential Revision: https://reviews.llvm.org/D94017
flang/include/flang/Common/Fortran.h
flang/include/flang/Evaluate/call.h
flang/include/flang/Parser/parse-tree.h
flang/lib/Evaluate/call.cpp
flang/lib/Evaluate/formatting.cpp
flang/lib/Semantics/check-call.cpp
flang/lib/Semantics/expression.cpp
flang/test/Semantics/altreturn06.f90 [new file with mode: 0644]