[Bug c++/42853] New: omp private vector

annacegu at yahoo dot com dot au gcc-bugzilla@gcc.gnu.org
Sun Jan 24 04:03:00 GMT 2010


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.


-- 
           Summary: omp private vector
           Product: gcc
           Version: 4.2.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: annacegu at yahoo dot com dot au


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42853



More information about the Gcc-bugs mailing list