This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33435] internal compiler error with templates and openmp
- From: "E dot Kuemmerle at fz-juelich dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Sep 2007 09:40:26 -0000
- Subject: [Bug c++/33435] internal compiler error with templates and openmp
- References: <bug-33435-15097@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from E dot Kuemmerle at fz-juelich dot de 2007-09-19 09:40 -------
Here is a self-contained example:
template<class T, int Sz>
class Vector {
public:
explicit Vector() {}
~Vector() {}
private:
T m_data[Sz];
};
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
}
}
}
I can avoid the internal compiler error by:
1) removing the '-fopenmp' option
2) changing the '#pragma omp' statements as shown in the original example
3) removing the destructor '~Vector() {}' from 'class Vector' in the new
example!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33435