g++: Internal compiler error

Peter Schmid schmid@ltoi.iap.physik.tu-darmstadt.de
Sat Mar 14 12:14:00 GMT 1998


egcs-2.91.13 generates an internal compiler error while compiling the
following file.  
The program works as expected with the previous egcs-snapshot egcs-2.91.12.

Peter Schmid

cat t2.C
#include<iostream>
#include<list>

template <class T>
void rev(const list<T>& L)
{
   list<T>::const_reverse_iterator rfirst(L.end());
   list<T>::const_reverse_iterator rlast(L.begin());

   while (rfirst != rlast)
      cout << *rfirst++ << endl;
 }

int array [] = { 1, 5, 2, 3 };

int main ()
{
    list<int> v (array, array + 4);
    rev(v);
}

cd /dos/peter/ftp/
g++ -v -o t2 t2.C -W -Wall 
Reading specs from /usr/lib/gcc-lib/i386-pc-linux-gnulibc1/egcs-2.91.13/specs
gcc version egcs-2.91.13 980308 (gcc-2.8.0 release)
 /usr/lib/gcc-lib/i386-pc-linux-gnulibc1/egcs-2.91.13/cpp -lang-c++ -v
-undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91
-D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix
-D__linux -Asystem(posix) -D__EXCEPTIONS -W -Wall -Di386
-Asystem(unix) -Acpu(i386) -Amachine(i386) -D__i386__ -Asystem(unix)
-Acpu(i386) -Amachine(i386) t2.C t2.ii 
GNU CPP version egcs-2.91.13 980308 (gcc-2.8.0 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/g++
 /usr/local/include
 /usr/i386-pc-linux-gnulibc1/include
 /usr/lib/gcc-lib/i386-pc-linux-gnulibc1/egcs-2.91.13/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i386-pc-linux-gnulibc1/egcs-2.91.13/cc1plus t2.ii -quiet -dumpbase t2.cc -W -Wall -version -o t2.s
GNU C++ version egcs-2.91.13 980308 (gcc-2.8.0 release)
(i386-pc-linux-gnulibc1) compiled by GNU C version egcs-2.91.13 980308
(gcc-2.8.0 release). 
t2.C: In function `void rev<int>(const class
list<int,__default_alloc_template<false,0> > &)': 
t2.C:7: Internal compiler error.
t2.C:7: Please submit a full bug report to `egcs-bugs@cygnus.com'.





More information about the Gcc-bugs mailing list