[Bug c++/30558] New: ICE with gcc-4.2 when compiling blitz++-program using exceptions

supermar at gmx dot de gcc-bugzilla@gcc.gnu.org
Tue Jan 23 15:58:00 GMT 2007


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)


-- 
           Summary: ICE with gcc-4.2 when compiling blitz++-program using
                    exceptions
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: supermar at gmx dot de
  GCC host triplet: x86_64-unknown-linux-gnu


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



More information about the Gcc-bugs mailing list