This is an archive of the discontinued LLVM Phabricator instance.

[flang] Dodge bogus uninitialized data warning from gcc 10.1 via code cleanup
ClosedPublic

Authored by tskeith on Jun 12 2020, 9:36 AM.

Details

Summary

G++ 10.1 emits inappropriate "use of uninitialized data" warnings when
compiling f18. The warnings stem from two sites in templatized code
whose multiple instantiations magnified the number of warnings.

These changes dodge those warnings by making some innocuous changes to
the code. In the parser, the idiom defaulted(cut >> x), which yields a
parser that always succeeds, has been replaced with a new equivalent
pass<T>() parser that returns a default-constructed value T{} in an
arguably more readable fashion. This idiom was the only attestation of
the basic parser cut, so it has been removed and the remaining code
simplified. In Evaluate/traverse.h, a return {}; was replaced with a
return of a default-constructed member.

Diff Detail

Event Timeline

tskeith created this revision.Jun 12 2020, 9:36 AM
Herald added a project: Restricted Project. · View Herald Transcript
klausler accepted this revision.Jun 12 2020, 9:47 AM
This revision is now accepted and ready to land.Jun 12 2020, 9:47 AM
This revision was automatically updated to reflect the committed changes.