c++/4447: c++ ICE (segfault in mangle.c). Regression from 2.95.x!
jbuck@synopsys.COM
jbuck@synopsys.COM
Tue Oct 2 16:16:00 GMT 2001
>Number: 4447
>Category: c++
>Synopsis: c++ ICE (segfault in mangle.c). Regression from 2.95.x!
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Tue Oct 02 16:16:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Joe Buck
>Release: 3.0.2 20011002 (prerelease)
>Organization:
Synopsys
>Environment:
System: SunOS atrus 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-Enterprise
Architecture: sun4
host: sparc-sun-solaris2.7
build: sparc-sun-solaris2.7
target: sparc-sun-solaris2.7
configured with: ../gcc/configure --prefix=/u/jbuck/gcc-cvs
>Description:
With the attached code, gcc gets an internal compiler error.
The immediate cause is that a null pointer is passed to strlen.
The cc1plus stack trace is
#0 0xff2b6dec in strlen ()
#1 0xc6734 in write_expression (expr=0x3c2570)
at ../../gcc/gcc/cp/mangle.c:1818
#2 0xc67b4 in write_expression (expr=0x3c259c)
at ../../gcc/gcc/cp/mangle.c:1831
#3 0xc6ff4 in write_template_arg (node=0x3c2588)
at ../../gcc/gcc/cp/mangle.c:1941
#4 0xc6624 in write_template_args (args=0x3c2614)
at ../../gcc/gcc/cp/mangle.c:1740
#5 0xc4458 in write_name (decl=0x3c0af8, ignore_local_scope=0)
at ../../gcc/gcc/cp/mangle.c:712
#6 0xc5848 in write_type (type=0x3c0a28) at ../../gcc/gcc/cp/mangle.c:1393
#7 0xc6440 in write_bare_function_type (type=0x3c0ea0,
include_return_type_p=1, decl=0x3c7cd8) at ../../gcc/gcc/cp/mangle.c:1632
#8 0xc4320 in write_encoding (decl=0x3c7cd8) at ../../gcc/gcc/cp/mangle.c:657
#9 0xc7688 in mangle_decl_string (decl=0x3c7cd8)
at ../../gcc/gcc/cp/mangle.c:623
#10 0xc7940 in mangle_decl (decl=0x3c7cd8) at ../../gcc/gcc/cp/mangle.c:2200
>How-To-Repeat:
This simplified example is based on code for efficient fixed-point
arithmetic. To get the crash, do
gcc -c crash.ii
where crash.ii is
-------------------------------
template<bool B,int I>
class T {
public:
T(int);
};
template<bool B1,bool B2,int I1,int I2>
T<(B1&&B2),I1+I2-int(B1&&B2)>
func(T<B1,I1> a, T<B2,I2> b) {
return T<(B1&&B2),I1+I2-int(B1&&B2)> (I1+I2);
}
void foo(T<true,3> a, T<true,4>b) {
func(a, b);
}
-------------------------------
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-prs
mailing list