This is an archive of the discontinued LLVM Phabricator instance.

[flang] Disambiguate F(X)=Y case where F is a function returning a pointer
ClosedPublic

Authored by klausler on Apr 22 2022, 2:20 PM.

Details

Summary

F(X)=Y may be initially parsed as a statement function definition; an
existing pass will detect statement functions that should be rewritten
into assignment statemets with array element references as their
left-hand side variables. However, F() may also be a reference to a
function that returns a data pointer, and f18 did not handle this
case correctly.

The right fix is to rewrite the parse tree for F(X)=Y into an assignment
to a function reference result. The cases that are actually assignments
to array elements -- including all of the cases previously handled --
will have their left-hand sides converted to array element references
later by another existing rewriting step.

Diff Detail

Event Timeline

klausler created this revision.Apr 22 2022, 2:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2022, 2:20 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.Apr 22 2022, 2:20 PM
jeanPerier accepted this revision.Apr 25 2022, 1:13 AM

Looks good

This revision is now accepted and ready to land.Apr 25 2022, 1:13 AM