This code successfully compiled but on run crashes: // { dg-do run } extern "C" void abort (); int dothrow; int g; static void f1() { g++; if (dothrow) throw 1; } static void f2() { __transaction_atomic { f1(); } } int main() { dothrow = 0; f2(); dothrow = 1; try { f2(); } catch (...) { } if (g != 2) abort (); return 0; } ------------------------------------------------------------------------- Coompiler: $ g++ -v Using built-in specs. COLLECT_GCC=e:\mingw32\bin\g++.exe COLLECT_LTO_WRAPPER=e:/mingw32/bin/../libexec/gcc/i686-w64-mingw32/4.7.0/lto-wrapper.exe Target: i686-w64-mingw32 Configured with: ../../mingw-src/gcc-4.7.0/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --enable-targets=all --enable-multilib --prefix=/./mingw-x32 --with-sysroot=/./mingw-x32 --with-tune=generic --enable-languages=c,c++,lto,fortran --enable-libstdcxx-time=yes --with-host-libstdcxx='-static -lstdc++' --enable-shared --enable-static --enable-threads=posix --enable-libgomp --enable-lto --enable-graphite --enable-cloog-backend=isl --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --enable-sjlj-exceptions --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-debug --disable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-gmp=/./mingw-libs-x32 --with-mpfr=/./mingw-libs-x32 --with-mpc=/./mingw-libs-x32 --with-ppl=/./mingw-libs-x32 --with-cloog=/./mingw-libs-x32 CFLAGS='-O3 -pipe -fomit-frame-pointer -momit-leaf-frame-pointer -I/./mingw-libs-x32/include' CXXFLAGS='-O3 -pipe -fomit-frame-pointer -momit-leaf-frame-pointer' CPPFLAGS= LDFLAGS='-pipe -s -L/./mingw-libs-x32/lib' Thread model: posix gcc version 4.7.0 ------------------------------------------------------------------------- Output log from gdb: Program received signal SIGSEGV, Segmentation fault. (anonymous namespace)::serialirr_dispatch::ITM_RU4 (this=0x81c0d8, ptr=0x1) at E:/msys/mingw-src/gcc-4.7.0/libitm/method-serial.cc:90 90 CREATE_DISPATCH_METHODS(virtual, ) -------------------------------------------------------------------------
Based to your e-mail on gcc-help, you left out a very important piece of information. This is using a build with the following patch: > Moreover, if I replace line 134 in file gccroot/libitm/configure.tgt [1] from: > > | *-*-darwin* | *-*-aix*) > to: > > | *-*-darwin* | *-*-aix* | *-w64-mingw32) As far as I know libitm is not expected to work on MinGW.
>Based to your e-mail on gcc-help, you left out a very important piece of information. Yes, Ian. I had to mention it. And yes, I'm not saying that libitm is supported by MinGW. And yes, as libitm is not supported by MinGW - it's not a bug. I hurried with the creation of the bug report. I'd really like to make libitm work with MinGW. I would like to understand why SIGSEGV occurs... Thanks.
(In reply to comment #2) > >Based to your e-mail on gcc-help, you left out a very important piece of > information. > Yes, Ian. I had to mention it. > And yes, I'm not saying that libitm is supported by MinGW. And yes, as libitm > is not supported by MinGW - it's not a bug. I hurried with the creation of the > bug report. > > I'd really like to make libitm work with MinGW. I would like to understand why > SIGSEGV occurs... > > Thanks. Well, the configure patch required for this bug-report misses an important part AFAICS. You have to make sure that pthread-API is present, as libitm depends on pthread. This report is btw invalid, as this feature isn't supported for mingw targets right now. So I close it. Please keep discussion about adding support for libitm on gcc's patches ML.