c++/885: c++: ice #283 in instantiate_template at cp/pt.c:7441
schmid@snake.iap.physik.tu-darmstadt.de
schmid@snake.iap.physik.tu-darmstadt.de
Sat Nov 25 10:16:00 GMT 2000
>Number: 885
>Category: c++
>Synopsis: c++: ice #283 in instantiate_template at cp/pt.c:7441
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Sat Nov 25 10:16:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Peter Schmid
>Release: 2.97 20001120 (experimental)
>Organization:
TU Darmstadt
>Environment:
System: Linux kiste 2.4.0-test10 #20 Thu Nov 2 03:02:57 CET 2000 i686 unknown
Architecture: i686
GNU assembler 001002
GLIBC 2.1.3
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Configured with: ../gcc-20001120/configure -enable-shared --disable-nls --enable-threads=posix --enable-long-long --enable-libstdcxx-v3
gcc version 2.97 20001120 (experimental)
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-20001120/configure -enable-shared --disable-nls --enable-threads=posix --enable-long-long --enable-libstdcxx-v3
>Description:
The following program ta2.C generates an internal compiler error. The
programm compiled without a problem with the previous compiler
snapshot. When the virtual method void e(r a) is removed, the
compiler generates no error.
>How-To-Repeat:
cat ta2.C
void tests();
template<class T>
class A {
public:
A(){};
A(const A<T> ©){};
virtual ~A(){};
};
template<class T>
class B {
public:
B(){};
B(const B &){};
virtual ~B(){};
};
class C {
public:
enum r {};
virtual void e(r a){};
};
template<class T>
class D
: public C,
private A<T>
{
public:
D(){};
};
template<class T>
class E
: public C,
private B<T>
{
public:
E(){};
};
template<class T>
class F
: public D<T>
{
public:
F(){};
};
template<class T>
class G
: public F<T>
{
public:
G(){};
};
template<class T>
class H
: public E<T>
{
public:
H(){};
};
template<class T>
class I
: public H<T>
{
public:
I(){};
};
int main()
{
tests();
}
template<class T>
void f(G<T> d)
{
}
template<class T>
void g(G<T> &d)
{
f(d);
}
void test1()
{
G<int> d;
g(d);
}
template<class T>
void f(I<T> d)
{
}
template<class T>
void g(I<T> &d)
{
f(d);
}
void test2()
{
I<int> d;
g(d);
}
void tests()
{
test1();
test2();
}
g++ -Wall -v ta2.C -g -save-temps
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Configured with: ../gcc-20001120/configure -enable-shared --disable-nls --enable-threads=posix --enable-long-long --enable-libstdcxx-v3
gcc version 2.97 20001120 (experimental)
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/cpp0 -lang-c++ -v -D__GNUC__=2 -D__GNUC_MINOR__=97 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__STDC_HOSTED__=1 -g -Wall -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ ta2.C ta2.ii
GNU CPP version 2.97 20001120 (experimental) (cpplib) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include/g++-v3
/usr/local/include
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/include
/usr/local/i686-pc-linux-gnu/include
/usr/include
End of search list.
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/cc1plus -fpreprocessed ta2.ii -lang-c++ -D__GNUG__=2 -D__GXX_ABI_VERSION=100 -quiet -dumpbase ta2.C -g -Wall -version -fnew-abi -o ta2.s
GNU C++ version 2.97 20001120 (experimental) (i686-pc-linux-gnu) compiled by GNU C version 2.97 20001120 (experimental).
ta2.C: In function `void g(I<T>&) [with T = int]':
ta2.C:111: instantiated from here
ta2.C:105: Internal error #283.
ta2.C:105: Internal compiler error in instantiate_template, at cp/pt.c:7441
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.
Preprocessor source ta2.ii follows:
# 1 "ta2.C"
void tests();
template<class T>
class A {
public:
A(){};
A(const A<T> ©){};
virtual ~A(){};
};
template<class T>
class B {
public:
B(){};
B(const B &){};
virtual ~B(){};
};
class C {
public:
enum r {};
virtual void e(r a){};
};
template<class T>
class D
: public C,
private A<T>
{
public:
D(){};
};
template<class T>
class E
: public C,
private B<T>
{
public:
E(){};
};
template<class T>
class F
: public D<T>
{
public:
F(){};
};
template<class T>
class G
: public F<T>
{
public:
G(){};
};
template<class T>
class H
: public E<T>
{
public:
H(){};
};
template<class T>
class I
: public H<T>
{
public:
I(){};
};
int main()
{
tests();
}
template<class T>
void f(G<T> d)
{
}
template<class T>
void g(G<T> &d)
{
f(d);
}
void test1()
{
G<int> d;
g(d);
}
template<class T>
void f(I<T> d)
{
}
template<class T>
void g(I<T> &d)
{
f(d);
}
void test2()
{
I<int> d;
g(d);
}
void tests()
{
test1();
test2();
}
Assembler source ta2.s:
.file "ta2.ii"
.version "01.01"
.stabs "/home/peter/",100,0,0,.Ltext0
.stabs "ta2.ii",100,0,0,.Ltext0
.text
.Ltext0:
.stabs "gcc2_compiled.", 0x3c, 0, 0, 0
.stabs "int:t(0,1)=r(0,1);-2147483648;2147483647;",128,0,0,0
.stabs "char:t(0,2)=r(0,2);0;127;",128,0,0,0
.stabs "long int:t(0,3)=r(0,3);-2147483648;2147483647;",128,0,0,0
.stabs "unsigned int:t(0,4)=r(0,4);0000000000000;0037777777777;",128,0,0,0
.stabs "long unsigned int:t(0,5)=r(0,5);0000000000000;0037777777777;",128,0,0,0
.stabs "long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0,0
.stabs "long long unsigned int:t(0,7)=@s64;r(0,7);0000000000000;01777777777777777777777;",128,0,0,0
.stabs "short int:t(0,8)=@s16;r(0,8);-32768;32767;",128,0,0,0
.stabs "short unsigned int:t(0,9)=@s16;r(0,9);0;65535;",128,0,0,0
.stabs "signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0
.stabs "unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0
.stabs "bool:t(0,12)=@s8;-16;",128,0,0,0
.stabs "float:t(0,13)=r(0,1);4;0;",128,0,0,0
.stabs "double:t(0,14)=r(0,1);8;0;",128,0,0,0
.stabs "long double:t(0,15)=r(0,1);12;0;",128,0,0,0
.stabs "complex int:t(0,16)=s8real:(0,1),0,32;imag:(0,1),32,32;;",128,0,0,0
.stabs "complex float:t(0,17)=r(0,17);8;0;",128,0,0,0
.stabs "complex double:t(0,18)=r(0,18);16;0;",128,0,0,0
.stabs "complex long double:t(0,19)=r(0,19);24;0;",128,0,0,0
.stabs "__builtin_va_list:t(0,20)=*(0,21)=(0,21)",128,0,0,0
.stabs "wchar_t:t(0,22)=r(0,22);0000000000000;0037777777777;",128,0,0,0
.stabs "__vtbl_ptr_type:t(0,23)=*(0,24)=f(0,1)",128,0,0,0
.stabs "r:t(0,25)=e;",128,0,21,0
.align 16
.stabs "main:F(0,1)",36,0,76,main
.globl main
.type main,@function
main:
.LFB1:
.stabs "ta2.C",132,0,0,.Ltext1
.Ltext1:
.stabn 68,0,76,.LM1-main
.LM1:
pushl %ebp
.LCFI0:
movl %esp, %ebp
.LCFI1:
subl $8, %esp
.LCFI2:
.stabn 68,0,77,.LM2-main
.LM2:
call _Z5testsv
.stabn 68,0,78,.LM3-main
.LM3:
movl $0, %eax
movl %ebp, %esp
popl %ebp
ret
.LFE1:
.Lfe1:
.size main,.Lfe1-main
.Lscope0:
.stabs "",36,0,0,.Lscope0-main
.globl __rethrow
.align 16
.stabs "_Z5test1v:F(0,21)",36,0,92,_Z5test1v
.globl _Z5test1v
.type _Z5test1v,@function
_Z5test1v:
.LFB2:
.stabn 68,0,92,.LM4-_Z5test1v
.LM4:
.LBB2:
pushl %ebp
.LCFI3:
movl %esp, %ebp
.LCFI4:
subl $24, %esp
.LCFI5:
.stabn 68,0,93,.LM5-_Z5test1v
.LM5:
subl $12, %esp
leal -24(%ebp), %eax
pushl %eax
.LCFI6:
call _ZN1GIiEC1Ev
addl $16, %esp
.LEHB5:
.stabn 68,0,94,.LM6-_Z5test1v
.LM6:
subl $12, %esp
leal -24(%ebp), %eax
pushl %eax
call _Z1gIiEvR1GIT_E
addl $16, %esp
.LEHE5:
subl $12, %esp
leal -24(%ebp), %eax
pushl %eax
call _ZN1GIiED1Ev
addl $16, %esp
.LBE2:
jmp .L8
.p2align 4,,7
.L5:
.LEHB7:
subl $12, %esp
leal -24(%ebp), %eax
pushl %eax
call _ZN1GIiED1Ev
addl $16, %esp
subl $12, %esp
pushl $.LRTH5
call __rethrow
.p2align 4,,7
.L7:
.LEHE7:
.LCFI7:
call _ZSt9terminatev
.p2align 4,,7
.L8:
.stabn 68,0,95,.LM7-_Z5test1v
.LM7:
movl %ebp, %esp
popl %ebp
ret
.LFE2:
.Lfe2:
.size _Z5test1v,.Lfe2-_Z5test1v
.stabs "d:(0,26)=xsG<int>:",128,0,93,-24
.Lscope1:
.stabs "",36,0,0,.Lscope1-_Z5test1v
.align 16
.stabs "_Z5test2v:F(0,21)",36,0,109,_Z5test2v
.globl _Z5test2v
.type _Z5test2v,@function
_Z5test2v:
.LFB3:
.stabn 68,0,109,.LM8-_Z5test2v
.LM8:
.LBB3:
pushl %ebp
.LCFI8:
movl %esp, %ebp
.LCFI9:
subl $24, %esp
.LCFI10:
.stabn 68,0,110,.LM9-_Z5test2v
.LM9:
subl $12, %esp
leal -24(%ebp), %eax
pushl %eax
.LCFI11:
call _ZN1IIiEC1Ev
addl $16, %esp
.LEHB10:
.stabn 68,0,111,.LM10-_Z5test2v
.LM10:
subl $12, %esp
leal -24(%ebp), %eax
pushl %eax
call _Z1gIiEvR1IIT_E
addl $16, %esp
.LEHE10:
subl $12, %esp
leal -24(%ebp), %eax
pushl %eax
call _ZN1IIiED1Ev
addl $16, %esp
.LBE3:
jmp .L13
.p2align 4,,7
.L10:
.LEHB12:
subl $12, %esp
leal -24(%ebp), %eax
pushl %eax
call _ZN1IIiED1Ev
addl $16, %esp
subl $12, %esp
pushl $.LRTH10
call __rethrow
.p2align 4,,7
.L12:
.LEHE12:
.LCFI12:
call _ZSt9terminatev
.p2align 4,,7
.L13:
.stabn 68,0,112,.LM11-_Z5test2v
.LM11:
movl %ebp, %esp
popl %ebp
ret
.LFE3:
.Lfe3:
.size _Z5test2v,.Lfe3-_Z5test2v
.stabs "d:(0,27)=xsI<int>:",128,0,110,-24
.Lscope2:
.stabs "",36,0,0,.Lscope2-_Z5test2v
.align 16
.stabs "_Z5testsv:F(0,21)",36,0,115,_Z5testsv
.globl _Z5testsv
.type _Z5testsv,@function
_Z5testsv:
.LFB4:
.stabn 68,0,115,.LM12-_Z5testsv
.LM12:
pushl %ebp
.LCFI13:
movl %esp, %ebp
.LCFI14:
subl $8, %esp
.LCFI15:
.stabn 68,0,116,.LM13-_Z5testsv
.LM13:
call _Z5test1v
.stabn 68,0,117,.LM14-_Z5testsv
.LM14:
call _Z5test2v
.stabn 68,0,118,.LM15-_Z5testsv
.LM15:
movl %ebp, %esp
popl %ebp
ret
.LFE4:
.Lfe4:
.size _Z5testsv,.Lfe4-_Z5testsv
.Lscope3:
.stabs "",36,0,0,.Lscope3-_Z5testsv
.section .gnu.linkonce.t._ZN1GIiEC1Ev,"ax",@progbits
.align 16
.stabs "_ZN1GIiEC1Ev:F(0,21)",36,0,56,_ZN1GIiEC1Ev
.stabs "this:p(0,28)=*(0,26)",160,0,56,8
.weak _ZN1GIiEC1Ev
.type _ZN1GIiEC1Ev,@function
_ZN1GIiEC1Ev:
.LFB5:
.stabn 68,0,56,.LM16-_ZN1GIiEC1Ev
.LM16:
pushl %ebp
.LCFI16:
movl %esp, %ebp
.LCFI17:
pushl %ebx
.LCFI18:
subl $4, %esp
.LCFI19:
movl 8(%ebp), %ebx
subl $12, %esp
pushl %ebx
.LCFI20:
call _ZN1FIiEC2Ev
addl $16, %esp
movl $_ZTV1GIiE, %eax
addl $8, %eax
movl %eax, (%ebx)
movl $_ZTV1GIiE, %eax
addl $28, %eax
movl %eax, 4(%ebx)
movl -4(%ebp), %ebx
movl %ebp, %esp
popl %ebp
ret
.LFE5:
.Lfe5:
.size _ZN1GIiEC1Ev,.Lfe5-_ZN1GIiEC1Ev
.stabs "this:r(0,28)",64,0,56,3
.Lscope4:
.stabs "",36,0,0,.Lscope4-_ZN1GIiEC1Ev
.section .gnu.linkonce.t._Z1gIiEvR1GIT_E,"ax",@progbits
.align 16
.stabs "_Z1gIiEvR1GIT_E:F(0,21)",36,0,86,_Z1gIiEvR1GIT_E
.stabs "d:p(0,29)=&(0,26)",160,0,86,8
.weak _Z1gIiEvR1GIT_E
.type _Z1gIiEvR1GIT_E,@function
_Z1gIiEvR1GIT_E:
.LFB6:
.stabn 68,0,86,.LM17-_Z1gIiEvR1GIT_E
.LM17:
pushl %ebp
.LCFI21:
movl %esp, %ebp
.LCFI22:
subl $24, %esp
.LCFI23:
.stabn 68,0,87,.LM18-_Z1gIiEvR1GIT_E
.LM18:
subl $8, %esp
pushl 8(%ebp)
leal -24(%ebp), %eax
pushl %eax
.LCFI24:
call _ZN1GIiEC1ERKS0_
addl $16, %esp
subl $12, %esp
leal -24(%ebp), %eax
pushl %eax
call _Z1fIiEv1GIT_E
addl $16, %esp
movl %ebp, %esp
popl %ebp
ret
.LFE6:
.Lfe6:
.size _Z1gIiEvR1GIT_E,.Lfe6-_Z1gIiEvR1GIT_E
.Lscope5:
.stabs "",36,0,0,.Lscope5-_Z1gIiEvR1GIT_E
.section .gnu.linkonce.t._ZN1IIiEC1Ev,"ax",@progbits
.align 16
.stabs "_ZN1IIiEC1Ev:F(0,21)",36,0,72,_ZN1IIiEC1Ev
.stabs "this:p(0,30)=*(0,27)",160,0,72,8
.weak _ZN1IIiEC1Ev
.type _ZN1IIiEC1Ev,@function
_ZN1IIiEC1Ev:
.LFB7:
.stabn 68,0,72,.LM19-_ZN1IIiEC1Ev
.LM19:
pushl %ebp
.LCFI25:
movl %esp, %ebp
.LCFI26:
pushl %ebx
.LCFI27:
subl $4, %esp
.LCFI28:
movl 8(%ebp), %ebx
subl $12, %esp
pushl %ebx
.LCFI29:
call _ZN1HIiEC2Ev
addl $16, %esp
movl $_ZTV1IIiE, %eax
addl $8, %eax
movl %eax, (%ebx)
movl $_ZTV1IIiE, %eax
addl $28, %eax
movl %eax, 4(%ebx)
movl -4(%ebp), %ebx
movl %ebp, %esp
popl %ebp
ret
.LFE7:
.Lfe7:
.size _ZN1IIiEC1Ev,.Lfe7-_ZN1IIiEC1Ev
.stabs "this:r(0,30)",64,0,72,3
.Lscope6:
.stabs "",36,0,0,.Lscope6-_ZN1IIiEC1Ev
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list