This is an archive of the discontinued LLVM Phabricator instance.

[Fortran] Set QUIET = .TRUE. in STOP statements
Needs RevisionPublic

Authored by rovka on May 24 2022, 1:14 AM.

Details

Summary

If QUIET is not specified, then the STOP statement issues warnings about
signaling exceptions (specifically INEXACT), which are not very
platform-independent. They're also not very concerning as long as the
end results are valid.

Diff Detail

Event Timeline

rovka created this revision.May 24 2022, 1:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2022, 1:14 AM
Herald added a subscriber: jdoerfert. · View Herald Transcript
rovka requested review of this revision.May 24 2022, 1:14 AM

Run the tests with NO_STOP_MESSAGE=1 in the environment.

sscalpone requested changes to this revision.May 24 2022, 8:36 AM
sscalpone added a subscriber: sscalpone.

Are you able to use the environment variable NO_STOP_MESSAGE=1 instead?

This revision now requires changes to proceed.May 24 2022, 8:36 AM
rovka added a comment.May 25 2022, 2:23 AM

I can do that, but I don't like that solution. My understanding is that these warnings are platform-dependent, and also the 'Fortran STOP' seems to be printed by default by flang. This means pretty much anyone running the test-suite with flang will have to set this environment variable, or else face a ton of failures. Why make the test-suite harder to run? I think one of the goals of the test-suite is to be independent from both the hardware and the compiler, and all the better if it's possible to achieve that without compiler-specific hacks. In this case, setting the STOP statement to QUIET makes sense to me because its output is not strictly defined by the standard and will vary with both hardware and compiler. The test-suite is not a good place to test warnings, error messages or other fuzzy output - that should go in flang's own tests.

I can do that, but I don't like that solution. My understanding is that these warnings are platform-dependent, and also the 'Fortran STOP' seems to be printed by default by flang. This means pretty much anyone running the test-suite with flang will have to set this environment variable, or else face a ton of failures. Why make the test-suite harder to run? I think one of the goals of the test-suite is to be independent from both the hardware and the compiler, and all the better if it's possible to achieve that without compiler-specific hacks. In this case, setting the STOP statement to QUIET makes sense to me because its output is not strictly defined by the standard and will vary with both hardware and compiler. The test-suite is not a good place to test warnings, error messages or other fuzzy output - that should go in flang's own tests.

FCVS is very old code; it antedates the recent STOP QUIET feature. We run it because Fortran is short on publicly available test suites and because we want to be able to say that we pass this old famous suite. I agree that it would be best if FCVS's official sources could be updated, but it's basically a museum piece now.

rovka added a comment.May 27 2022, 2:42 AM

FCVS is very old code; it antedates the recent STOP QUIET feature. We run it because Fortran is short on publicly available test suites and because we want to be able to say that we pass this old famous suite. I agree that it would be best if FCVS's official sources could be updated, but it's basically a museum piece now.

But they can be updated (at least in our own copy which resides here). The license only requires us to include a list of modifications, which we do here and which this patch updates :)