This is an archive of the discontinued LLVM Phabricator instance.

[flang] Extend common block size to cover equivalence storage
ClosedPublic

Authored by jeanPerier on Sep 2 2021, 7:11 AM.

Details

Summary

The size of common block should be extended to cover any storage
sequence that are storage associated with the common block via
equivalences (8.10.2.2 point 1 (2)).

In symbol size and offset computation, the size of the common block
was not always extended to cover storage association. It was only done
if the "base symbol of an equivalence group"(*) appeared in a common block
statement. Correct this to cover all cases where a symbol appearing in a
common block statement is storage associated.

(*) the base symbol of an equivalence group is the symbol whose storage
starts first in a storage association (if several symbols starts first,
the base symbol is the last one visited by the algorithm going through
the equivalence sets).

Diff Detail

Event Timeline

jeanPerier created this revision.Sep 2 2021, 7:11 AM
jeanPerier requested review of this revision.Sep 2 2021, 7:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2021, 7:11 AM
klausler accepted this revision.Sep 2 2021, 9:22 AM
This revision is now accepted and ready to land.Sep 2 2021, 9:22 AM
schweitz added inline comments.
flang/lib/Semantics/compute-offsets.cpp
157

Did you mean to create a second eqIter? Maybe a different name would help?

jeanPerier added inline comments.Sep 8 2021, 7:52 AM
flang/lib/Semantics/compute-offsets.cpp
157

No, it was meant to be the same, thanks for catching this.