[PATCH] D81747: [flang] Dodge bogus uninitialized data warning from gcc 10.1 via code cleanup

Tim Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 09:45:37 PDT 2020


tskeith created this revision.
tskeith added reviewers: PeteSteinfeld, sscalpone.
tskeith added a project: Flang.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: DavidTruby.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
tskeith added a reviewer: klausler.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81747

Files:
  flang/documentation/ParserCombinators.md
  flang/include/flang/Evaluate/traverse.h
  flang/lib/Parser/Fortran-parsers.cpp
  flang/lib/Parser/basic-parsers.h
  flang/lib/Parser/program-parsers.cpp
  flang/lib/Parser/stmt-parser.h
  flang/lib/Parser/token-parsers.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81747.270430.patch
Type: text/x-patch
Size: 10911 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200612/9ef62bd1/attachment.bin>


More information about the llvm-commits mailing list