Hello,
There are many Fortran tests (e.g. Fujitsu test suite and others) that assume that the variables in Fortran main program have implicit SAVE attribute. These tests don’t initialize such variables in some cases, relying on them having been automatically initialized to zero. With -fno-save-main-program being the default, such tests encounter undefined behavior.
Having investigated numerous failures due to the undefined behavior and having to add -fsave-main-program to all those cases, I’m wondering if it would be safer to make -fsave-main-program a default behavior in flang.
I understand that -fno-save-main-program was made default for performance reasons, but I was also told that using norecurse
on QQmain program may resolve at least some of the performance issues. (Tagging @jeanPerier )
The PR to flip the behavior: [flang] Make -fsave-main-program default by eugeneepshteyn · Pull Request #137090 · llvm/llvm-project · GitHub
Please let me know your thoughs.
Thank you,
Eugene