This is an archive of the discontinued LLVM Phabricator instance.

[flang] fulfill -Msave/-fno-automatic in main programs too
ClosedPublic

Authored by jeanPerier on Mar 14 2022, 8:21 AM.

Details

Summary

semantics::IsSaved() was not applying -Msave/-fno-automatic for main programs.
This caused issues since lowering relies on it to allocate static
variables. This did not match nvfortran/gfortran behaviors where
-fno-automatic/-Msave control the static allocation of scalars in
main programs.

Some program may rely on main program scalars to be statically allocated in
bss (and therefore initialized to zero) with -Msave/-fno-automatic
flags.

Diff Detail

Event Timeline

jeanPerier created this revision.Mar 14 2022, 8:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2022, 8:21 AM
Herald added a subscriber: jdoerfert. · View Herald Transcript
jeanPerier requested review of this revision.Mar 14 2022, 8:21 AM
klausler accepted this revision.Mar 14 2022, 9:19 AM
This revision is now accepted and ready to land.Mar 14 2022, 9:19 AM