Menu

#1645 Crash while executing complex sqrt in C++

OTHER
open
Bug
none
Unknown
False
2013-02-11
2012-06-14
No

compiling following code with g++ leads to a crash while executing the sqrt function. Compiled fine with the older gcc versions.

#include<complex>
int main()
{
std::complex<double> x(1., 0.);
std::sqrt(x);
return 0;
}

$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.7.0/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.7.0/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++
--disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-r
egistry --enable-libstdcxx-debug --disable-build-poststage1-with-cxx --enable-version-spec
ific-runtime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.7.0 (GCC)

$ ld -v
GNU ld (GNU Binutils) 2.22

Discussion

  • Earnie Boyd

    Earnie Boyd - 2012-06-14

    Are all your libraries compiled with 4.7.0, including the mingw runtime and w32api?

     
  • Earnie Boyd

    Earnie Boyd - 2012-06-14
    • assigned_to: nobody --> cstrauss
     
  • Earnie Boyd

    Earnie Boyd - 2012-06-14
    • labels: 103944 --> gcc-4.7.0
     
  • Sebastian Macke

    Sebastian Macke - 2012-06-14

    I did not compile any libraries.by my own. This are the steps two reproduce the error:

    1. install mingw
    use pre-packaged repository catalogues

    2.
    > g++ -v
    gcc version 4.6.2
    > g++ sqrt_test.c
    > ./a.exe
    -> works

    3.
    > mingw-get update
    > mingw-get upgrade

    4.
    > g++ -v
    gcc version 4.7.0
    > g++ sqrt_test.c
    > ./a.exe
    -> crash

     
  • Earnie Boyd

    Earnie Boyd - 2013-02-11
    • labels: gcc-4.7.0 --> gcc-4.7.0, gcc
    • milestone: --> OTHER
    • type: --> Bug
    • resolution: --> none
    • category: --> Unknown
    • patch_attached: --> False