Page MenuHomePhabricator

[flang] Tighten rules to resolve procedure as intrinsic procedure
ClosedPublic

Authored by jeanPerier on Oct 23 2020, 8:37 AM.

Details

Summary

2 Bug fixes:

  • Do not resolve procedure as intrinsic if they appeared in an EXTERNAL attribute statement (one path was not considering this flag)
  • Emit an error if a procedure resolved to be an intrinsic function (resp. subroutine) is used as a subroutine (resp. function). Lowering was attempted while the evaluate::Expression for the call was missing without any errors.

1 behavior change:

  • Do not implicitly resolve subroutines (resp. functions) as intrinsics because their name is the name of an intrinsic function (resp. subroutine). Add justification in documentation.

Diff Detail

Event Timeline

jeanPerier created this revision.Oct 23 2020, 8:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 23 2020, 8:37 AM
jeanPerier requested review of this revision.Oct 23 2020, 8:37 AM
tskeith accepted this revision.Oct 23 2020, 9:21 AM
tskeith added inline comments.
flang/lib/Semantics/resolve-names.cpp
169

Typo: Symbol -> Subroutine

This revision is now accepted and ready to land.Oct 23 2020, 9:21 AM
klausler accepted this revision.Oct 23 2020, 10:41 AM

Looks great to me; thanks!

flang/docs/Intrinsics.md
711

English: "f18 will always consider this case to be the intrinsic..."

724

sp. "rationale".

734

"procedure" should be singular

735

"resolve" or "prevent" or "forestall", not "raise"

Thanks for the reviews. Fix typos in documentation an error message.

jeanPerier marked 5 inline comments as done.Mon, Oct 26, 3:23 AM
This revision was landed with ongoing or failed builds.Mon, Oct 26, 3:27 AM
This revision was automatically updated to reflect the committed changes.