[PATCH] D85136: [flang] Fix bug detecting intrinsic function
Tim Keith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 3 07:44:25 PDT 2020
tskeith created this revision.
tskeith added reviewers: klausler, PeteSteinfeld.
tskeith added a project: Flang.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: DavidTruby.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
tskeith requested review of this revision.
Don't set the INTRINSIC attribute on a dummy procedure.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D85136
Files:
flang/lib/Semantics/resolve-names.cpp
flang/test/Semantics/symbol18.f90
Index: flang/test/Semantics/symbol18.f90
===================================================================
--- flang/test/Semantics/symbol18.f90
+++ flang/test/Semantics/symbol18.f90
@@ -19,3 +19,13 @@
!REF: /p1/x
y = f(x)
end program
+
+!DEF: /f2 (Function) Subprogram REAL(4)
+!DEF: /f2/cos EXTERNAL (Function, Implicit) ProcEntity REAL(4)
+!DEF: /f2/x (Implicit) ObjectEntity REAL(4)
+function f2(cos, x)
+ !DEF: /f2/f2 (Implicit) ObjectEntity REAL(4)
+ !REF: /f2/cos
+ !REF: /f2/x
+ f2 = cos(x)
+end function
Index: flang/lib/Semantics/resolve-names.cpp
===================================================================
--- flang/lib/Semantics/resolve-names.cpp
+++ flang/lib/Semantics/resolve-names.cpp
@@ -5749,7 +5749,8 @@
// error was reported
} else {
symbol = &Resolve(name, symbol)->GetUltimate();
- if (ConvertToProcEntity(*symbol) && IsIntrinsic(symbol->name())) {
+ if (ConvertToProcEntity(*symbol) && IsIntrinsic(symbol->name()) &&
+ !IsDummy(*symbol)) {
symbol->attrs().set(Attr::INTRINSIC);
// 8.2(3): ignore type from intrinsic in type-declaration-stmt
symbol->get<ProcEntityDetails>().set_interface(ProcInterface{});
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85136.282622.patch
Type: text/x-patch
Size: 1192 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200803/55da2c28/attachment.bin>
More information about the llvm-commits
mailing list