As OpenMP Spec 5.0, to avoid the data races, concurrent updates of the
original list item must be synchronized with the read of the original
list item that occurs as a result of the firstprivate clause. Adding
barrier(s) before and/or after the worksharing region would remove the
data races, and it is the application(user)'s job. However, when
one list item is in both firstprivate and lastprivate clauses, the
synchronization should be ensured by compiler since the lastprivate
clause follows the reads of the original list item performed for the
initialization of each of the firstprivate list item.
Add FIXME and TODO for two special cases, sections construct and linear
clause.
The data race problem for single construct will be handled later.
This implementation is based on the discussion with OpenMP committee and
clang code (clang/lib/CodeGen/CGStmtOpenMP.cpp).