This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/33435] New: internal compiler error with templates and openmp


I get the error message

bug.cpp:16: internal compiler error: in create_tmp_var, at gimplify.c:487

when compiling the following code with

g++ -fopenmp -DTVMET_OPTIMIZE -c bug.cpp

where bug.cpp contains:

#include <tvmet/Vector.h>           // Tiny Vector Matrix library using
Expression Templates
#include <tvmet/VectorFunctions.h>  // http://tvmet.sourceforge.net/
using namespace tvmet;

int main() {
  Vector<int,3> a[10];
  int i;
#pragma omp parallel
  {
#pragma omp for schedule(dynamic)
    for (i=0; i<10; ++i) {
      // do something
    }
#pragma omp master
    {
        a[0] = a[1];
    }
#pragma omp for schedule(dynamic)
    for (i=0; i<10; ++i) {
      // do something
    }
  }
}

The problem is definitely related to openmp because the following code compiles
without any error:

#include <tvmet/Vector.h>           // Tiny Vector Matrix library using
Expression Templates
#include <tvmet/VectorFunctions.h>  // http://tvmet.sourceforge.net/
using namespace tvmet;

int main() {
  Vector<int,3> a[10];
  int i;
#pragma omp parallel for schedule(dynamic)
  for (i=0; i<10; ++i) {
    // do something
  }
  a[0] = a[1];
#pragma omp parallel for schedule(dynamic)
  for (i=0; i<10; ++i) {
    // do something
  }
}


-- 
           Summary: internal compiler error with templates and openmp
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: E dot Kuemmerle at fz-juelich dot de
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]