Two problems here. The first was trying to show that we don't necessarily honor the requirement that all firstprivate copies are executed before the lastprivate assignment happens. The second is that we're not properly substituting for the global X here within the scope of the privatization.
-- Summary: [gomp] firstprivate not working properly with non-POD Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: wrong-code, openmp Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rth at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26943