This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Internal errors 40 & 980715



Hi..

I have problem with pointer to template function. 
Im using egcs-1.1a on linux.

try..
g++ -c test.cc           -> internal error 980715
g++ -c -DERROR40 test.cc -> internal error 40
g++ -c -DNOERROR test.cc -> Ok!

Code...
test.cc
------------------------------
// Build don't link

void call( void(*)(void*) ) {}
template<class T> static void callb(void* arg) {}

template<class T> class test 
{
public:
  test() 
  {
#ifdef NOERROR
    void(*addr)(void*) = callb<T>;         // Works!
    call( addr );
#elif ERROR40
    call( callb );                         // Internal error 40
#else
    call( callb<T> );                      // Intrenal error 980715
#endif
  }
};

static test<int> koe;
------------------------------


Robotti:~/ohj% gcc -v -c test2.cc
Reading specs from
/usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/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 -Asystem(unix) -Acpu(i386)
-Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686
-D__i686__ -D__pentiumpro -D__pentiumpro__ test2.cc /tmp/ccLxA5qH.ii
GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++
 /usr/local/include
 /usr/local/i686-pc-linux-gnulibc1/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/cc1plus
/tmp/ccLxA5qH.ii -quiet -dumpbase test2.cc -version -o /tmp/ccmnfzjh.s
GNU C++ version egcs-2.91.57 19980901 (egcs-1.1 release)
(i686-pc-linux-gnulibc1) compiled by GNU C version 2.7.2.3.
test2.cc: In method `test<int>::test<int>()':
test2.cc:23:   instantiated from here
test2.cc:18: Internal compiler error 980715.
test2.cc:18: Please submit a full bug report to `egcs-bugs@cygnus.com'.

.... and error 40 ....

Robotti:~/ohj% gcc -v -c -DERROR40 test2.cc 
Reading specs from
/usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/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 -Asystem(unix) -Acpu(i386)
-Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686
-D__i686__ -D__pentiumpro -D__pentiumpro__ -DERROR40 test2.cc
/tmp/ccgtrz3C.ii
GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++
 /usr/local/include
 /usr/local/i686-pc-linux-gnulibc1/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/cc1plus
/tmp/ccgtrz3C.ii -quiet -dumpbase test2.cc -version -o /tmp/ccWueEx8.s
GNU C++ version egcs-2.91.57 19980901 (egcs-1.1 release)
(i686-pc-linux-gnulibc1) compiled by GNU C version 2.7.2.3.
test2.cc: In method `test<int>::test<int>()':
test2.cc:23:   instantiated from here
test2.cc:16: Internal compiler error 40.
test2.cc:16: Please submit a full bug report to `egcs-bugs@cygnus.com'.

As you see i have workaround for this problem, so its not big
problem.  :-)

  Tomi Pakarinen





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]