I try to compile the following code: #include <omp.h> #include <vector> using std::vector; int main() { vector<int> kdPoints; vector<int> results; vector<int>::iterator iter; vector<int> histogram; for (long long i = 0; i < 1000000; i++) kdPoints.push_back(i); histogram.push_back(0); #pragma omp parallel for private(results) for (long long i = 0; i < kdPoints.size(); i++) { #pragma omp critical {histogram[results.size()]++;} results.clear(); } } using g++-4.2 *.cpp -fopenmp I get the following message: bug_omp.cpp: In function ‘int main()’: bug_omp.cpp:0: internal compiler error: in lower_stmt, at gimple-low.c:282 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Works for me with GCC 4.3.4 and 4.4.2. GCC 4.2 is no longer maintained.