The following small program gives an segmentation fault when compiled like this: extgccsrc> g++ -Wall -fopenmp -O2 -I$POLDEST/ext/include -L$POLDEST/ext/lib -otest test.cc -lblitz -lgomp -lm test2.cc: In function ‘int main()’: test2.cc:7: internal compiler error: Segmentation fault When removing the 'try-catch'-part it works fine. ---- #include <iostream> #include <blitz/array.h> int main() { try { blitz::Array<blitz::TinyVector<float,3>,3> gradients(100,1,1); gradients = blitz::TinyVector<float,3>(0,0,0); #pragma omp parallel for for( int lev = 0; lev < 100; ++lev) { blitz::TinyVector<int,3> pos( lev,1,1); blitz::TinyVector<float,3> normGradForward = gradients(pos); blitz::TinyVector<float,3> normGradLeft = blitz::cross( normGradForward, normGradForward); } } catch( std::exception& err) { std::cerr << err.what() << std::endl << "try -h for help\n"; } return 0; } ---- Here my specs: extgccsrc> gcc -v Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: [...]/extgccsrc/gcc-4.2-20070117/configure --enable-languages=c,c++ --prefix=[...]/extgcc-x86_64_gcc4 --enable-shared --with-system-zlib --enable-threads=posix --enable-nls --enable-__cxa_atexit --without-included-gettext --enable-clocale=gnu --enable-libstdcxx-debug --enable-debug --with-mpfr=[...]/extgcc-x86_64_gcc4 --with-gmp=[...]/extgcc-x86_64_gcc4 --enable-checking=release --disable-multilib --disable-werror --enable-bootstrap Thread model: posix gcc version 4.2.0 20070117 (prerelease)
Can you attach the preprocessed source?
The uncompressed preprocessed source is 1,7MB (unless I'm doing something wrong here, it's just the -E flag to the usual compiler call, right?). I uploaded it to http://data.marssoft.de/attachment-bug-30558.bz2 Thanks.
reducing.
Created attachment 12944 [details] reduced testcase
Confirmed.
Just to note: I can confirm the bug for x86-architecture as well.
Even more reduced testcase: static int s = 6; template <typename T> struct F { ~F () {} F (T x) {} const T &operator[] (unsigned i) const { return s; } }; template <typename T> F<T> foo (const F<T> &x) { return F<T> (x[1]); } static F<int> z = 6; struct G { G () { bar (2); } F<int> &operator () (F<int> x) { return z; } void bar (int); }; int main () { try { G g; #pragma omp parallel for for (int i = 0; i < 10; ++i) { F<int> j (i); F<int> f = g (j); F<int> h = foo (f); } } catch (int &e) { } }
Subject: Bug 30558 Author: jakub Date: Thu Apr 26 08:29:46 2007 New Revision: 124177 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124177 Log: PR tree-optimization/30558 * tree-eh.c (lower_eh_filter): If EH_FILTER_MUST_NOT_THROW clear this_state.prev_try. * g++.dg/gomp/pr30558.C: New test. Added: trunk/gcc/testsuite/g++.dg/gomp/pr30558.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-eh.c
Subject: Bug 30558 Author: jakub Date: Thu Apr 26 08:35:28 2007 New Revision: 124179 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124179 Log: PR tree-optimization/30558 * tree-eh.c (lower_eh_filter): If EH_FILTER_MUST_NOT_THROW clear this_state.prev_try. * g++.dg/gomp/pr30558.C: New test. Added: branches/gcc-4_2-branch/gcc/testsuite/g++.dg/gomp/pr30558.C Modified: branches/gcc-4_2-branch/gcc/ChangeLog branches/gcc-4_2-branch/gcc/testsuite/ChangeLog branches/gcc-4_2-branch/gcc/tree-eh.c
Fixed (4.3/4.2/4.1-rh).