Menu

#1111 internal compiler error in main.cpp

OTHER
closed
nobody
gcc (462)
out-of-date
Unknown
2014-08-17
2007-12-05
John Pye
No

Hi there

I got this 'internal compiler error' Segfault with the following commandline:

g++ -o main.o -c -g -Wall "-IC:\Program Files\Boost-1.34.1\include" "-IC:\Program Files\GnuWin32\include" main.cpp
main.cpp:45: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.mingw.org/bugs.shtml> for instructions.
scons: building terminated because of errors.
scons: *** [main.o] Error 1

* OS version: XP

John@THUNDER ~/optx
$ gcc -v
Reading specs from c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw special)

John@THUNDER ~/optx
$ ld -v
GNU ld version 2.17.50 20060824

* mingw version MinGW-5.1.3.exe

* build environment: MSYS

John@THUNDER ~/optx
$ uname -a
MINGW32_NT-5.1 THUNDER 1.0.10(0.46/3/2) 2004-03-15 07:17 i686 unknown

* small test case demonstrating the bug: will send preprocessed code via email to the person following up this bug.

* mingw-runtime version:

#define __MINGW32_VERSION 3.13
#define __MINGW32_MAJOR_VERSION 3
#define __MINGW32_MINOR_VERSION 13

* w32api version:

#define __W32API_VERSION 3.10
#define __W32API_MAJOR_VERSION 3
#define __W32API_MINOR_VERSION 10

* any other detailed information pertinent to your experience with the bug

Previously compiled this code on another Windows system with no change, only change is that I am using GnuWin32 GSL instead of locally MSYS-compiled copy.

Cheers
JP

Discussion

  • John Pye

    John Pye - 2007-12-05
     
  • John Pye

    John Pye - 2007-12-05

    Logged In: YES
    user_id=849068
    Originator: YES

    Attached is a minimal example with preprocessed code.

    John@THUNDER ~/optx
    $ g++ example-pre.cpp
    [...]:45: internal compiler error: Segmentation fault
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <URL:http://www.mingw.org/bugs.shtml> for instructions.

    File Added: example-pre.cpp.bz2

     
  • Danny Smith

    Danny Smith - 2007-12-06

    Logged In: YES
    user_id=11494
    Originator: NO

    This appears to be dllimport issue, specifically with dllimport of
    explicit template specializations, like this in mirrorbundle.h (line 107)

    typedef ParametricTransform<MirrorBundle,ParametersMoveToNearest>
    TransformMoveToNearest;

    template<> extern __attribute__((dllimport)) MirrorBundle &
    TransformMoveToNearest::operator()(MirrorBundle &);

    There are two different problems 1) Older G++ has problem with vtable
    emission when an entry is a dllimport. This causes ICE that you see.
    Removing the dllimport from above template specialization importand others
    like it is workaround.

    2) G++ 4.3.0 reports: mirrorbundle.h:111: error: explicit template
    specialization cannot have a storage class.

    The "extern" in "template<> extern __attribute__((dllimport))" is
    unnecessary and invalid C++. Is is it required by MSVC?

     
  • John Pye

    John Pye - 2008-02-22
     
  • John Pye

    John Pye - 2008-02-22

    Logged In: YES
    user_id=849068
    Originator: YES

    Hi Danny

    I removed the 'extern' declation from the 'template<> extern __attribute__((dllimport))' as you suggested. It appears that it was not required (it was there as a result of a #defined macro that is also in use in other places where it *does* need the 'extern' part.

    I'm not sure what you meant by your (1) comment. Should I dllexport the symbol when creating my DLL but then omit the dllimport when making use of my DLL in other code?

    I'm attaching a new 'main-pre.cpp' that shows the error when run with 'g++ main-pre.cpp'.

    Cheers
    JP

    File Added: main-pre.cpp.bz2

     
  • Earnie Boyd

    Earnie Boyd - 2013-02-05
    • status: open --> closed
    • resolution: --> out-of-date
    • category: --> Unknown
    • milestone: --> OTHER