On cygwin system, used gcc 3.4.4 to compile gcc 4.1.0. Installed gcc 4.1.0 in /usr/local. While compiling Gecode (with "make"), from gecode-1.1.0.tar.gz, encountered the following error: search/reco-stack.cc:85: internal compiler error: in maybe_emit_vtables, at cp/decl2.c:1548 exact command sequence in top directory of gecode source tree: $ ./configure CC="/usr/local/bin/gcc.exe" CXX="/usr/local/bin/g++.exe" (lots of output) $ make (some output) ERROR MESSAGE AS ABOVE
Please read http://gcc.gnu.org/bugs.html and provide the preprocessed source.
Created attachment 11487 [details] Pre-processed output of reco-stack.cc, a gecode source file. reco-stack.cc is generating an internal compiler error. The attachment is this file as pre-processed. This file, and package of which it is a part, can be downloaded from the following URL: http://www.gecode.org/download/gecode-1.1.0.tar.gz
Command that generated attachment (reco-stack.ii): /usr/local/bin/g++.exe -v -save-temps -I. -I. -DNDEBUG -Wall -ggdb -O3 -fno-strict-aliasing -finline-limit=3000 -ffast-math -mthreads -DGECODE_BUILD_SEARCH -c -o search/reco-stack.o search/reco-stack.cc Output from this command: Using built-in specs. Target: i686-pc-cygwin Configured with: ../gcc-4.1.0/configure Thread model: single gcc version 4.1.0 /usr/local/libexec/gcc/i686-pc-cygwin/4.1.0/cc1plus.exe -E -quiet -v -I. -I. -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/../include/w32api -idirafter /usr/local/lib/gcc/i686-pc-cygwin/4.1.0/../../../../../include/w32api -DNDEBUG -DGECODE_BUILD_SEARCH search/reco-stack.cc -mthreads -mtune=pentiumpro -Wall -fno-strict-aliasing -finline-limit=3000 -ffast-math -fworking-directory -O3 -fpch-preprocess -o reco-stack.ii ignoring nonexistent directory "NONE/include" ignoring nonexistent directory "/usr/local/lib/gcc/i686-pc-cygwin/4.1.0/../../../../i686-pc-cygwin/include" ignoring duplicate directory "/usr/local/lib/gcc/i686-pc-cygwin/4.1.0/../../../../../include/w32api" ignoring duplicate directory "." #include "..." search starts here: #include <...> search starts here: . /usr/local/lib/gcc/i686-pc-cygwin/4.1.0/../../../../include/c++/4.1.0 /usr/local/lib/gcc/i686-pc-cygwin/4.1.0/../../../../include/c++/4.1.0/i686-pc-cygwin /usr/local/lib/gcc/i686-pc-cygwin/4.1.0/../../../../include/c++/4.1.0/backward /usr/local/include /usr/local/lib/gcc/i686-pc-cygwin/4.1.0/include /usr/include /usr/lib/../include/w32api
Output from gcc command in previous comment was incomplete. Here is the rest: End of search list. /usr/local/libexec/gcc/i686-pc-cygwin/4.1.0/cc1plus.exe -fpreprocessed reco-stack.ii -quiet -dumpbase reco-stack.cc -mthreads -mtune=pentiumpro -auxbase-strip search/reco-stack.o -ggdb -O3 -Wall -version -fno-strict-aliasing -finline-limit=3000 -ffast-math -o reco-stack.s GNU C++ version 4.1.0 (i686-pc-cygwin) compiled by GNU C version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125). GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 37c50bca8d9aa79de709cfd6b183fd23 search/reco-stack.cc:85: internal compiler error: in maybe_emit_vtables, at cp/decl2.c:1548 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
This is a dllimport bug. Dllimports do not have constant address. Hence class vtable cannot contain a method with dllimport attribute I am working on a patch. Here is reduced testcase: // dllimport_virtual.C struct base { virtual void key_method(); __attribute__((dllimport)) virtual ~base(); // Does not have a const address }; // Definition of key_method forces emmission of vtable void base::key_method() {};
Patch at: http://gcc.gnu.org/ml/gcc-patches/2006-05/msg01504.html Danny
Bugfix worked for me. Compilation definitely got farther. However, there's another bug. Pls. see bug 26622. Gecode may be a good compiler test package; it seems to use some advanced C++ features.
(In reply to comment #7) > Bugfix worked for me. Compilation definitely got farther. However, there's > another bug. Pls. see bug 26622. As mentioned in that PR, the problem there is unrelated to your code. The rtl pattern which is being complained about: (insn 491 490 492 18 ././kernel/core.icc:1448 (set (reg:SI 223) (const:SI (plus:SI (mem:SI (symbol_ref:SI ("#i._ZN6Gecode5Space3vtdE") <var_decl 0x19664f10 vtd>) [0 S4 A8]) (const_int 1024 [0x400])))) -1 (nil) (nil)) Why is this wrapping itself inside a const when it cannot be a const as it is loading from memory.
Subject: Bug 27650 Author: dannysmith Date: Wed Sep 20 23:27:05 2006 New Revision: 117096 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117096 Log: PR target/27650 * class.c (check_for_override): Remove dllimport from virtual methods. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/class.c
Subject: Bug 27650 Author: dannysmith Date: Wed Sep 20 23:32:07 2006 New Revision: 117097 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117097 Log: PR target/27650 * g++.dg/ext/dllimport12.C: New test. Added: trunk/gcc/testsuite/g++.dg/ext/dllimport12.C (with props) Modified: trunk/gcc/testsuite/ChangeLog Propchange: trunk/gcc/testsuite/g++.dg/ext/dllimport12.C ('svn:executable' added)
Fixed on trunk. Danny
Fixed.