This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix bug checking SAVE attribute
ClosedPublic

Authored by tskeith on Jun 22 2020, 8:43 AM.

Details

Summary

We were treating a SAVE statement without an entity-list as if it applied to all
items in a scoping unit, but it only applies to the allowed ones (8.6.14(1)).

Diff Detail

Event Timeline

tskeith created this revision.Jun 22 2020, 8:43 AM
Herald added a project: Restricted Project. · View Herald Transcript

Why not updating semantics::IsSaved to test IsFunctionResult instead like it is doing with IsDummy ?
Lowering relies on IsSaved to indicate whether something is implicitly or explicitly saved, so with this patch it looks like we would still create a global for f2b even if we should not.

PeteSteinfeld accepted this revision.Jun 22 2020, 10:12 AM

All builds, tests, and looks good.

This revision is now accepted and ready to land.Jun 22 2020, 10:12 AM
tskeith updated this revision to Diff 272488.Jun 22 2020, 10:16 AM

Move fix into IsSaved.

Why not updating semantics::IsSaved to test IsFunctionResult instead like it is doing with IsDummy ?
Lowering relies on IsSaved to indicate whether something is implicitly or explicitly saved, so with this patch it looks like we would still create a global for f2b even if we should not.

OK, I've done that.

sscalpone accepted this revision.Jun 22 2020, 10:51 AM
jeanPerier accepted this revision.Jun 22 2020, 11:22 AM

LGTM, thanks

This revision was automatically updated to reflect the committed changes.