Crash when executing the program below with OpenMP in Release x64.Create a project (console application) with this code.Build with /openmp and /O1 or /O2 or /Ox (Optimization) options in Release x64 configuration.The bug is also reproducible in VS 2005.In the dissasembly it looks like the push_back(0) was moved out of the critical section.#include <omp.h>#include <vector>class EmptyClass { public: EmptyClass() {} };class SuperEdge { public: SuperEdge() {mp_points[0] = NULL; mp_points[1] = NULL;} private: const int* mp_points[2]; };EmptyClass CreateEmptyClass(SuperEdge s) { return EmptyClass(); }int main(int argc, wchar_t* argv[], wchar_t* envp[]) { std::vector<int> v; long count = 1000000; SuperEdge edge; #pragma omp parallel for for(long i = 0; i < count; ++i) { EmptyClass p = CreateEmptyClass(edge); #pragma omp critical { v.push_back(0); } } return 0; }
Visual Studio/Silverlight/Tooling version
What category (if any) best represents this feedback?
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results