This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/8511: (hopefully) reproducible cc1plus SIGSEGV.
- From: reichelt at igpm dot rwth-aachen dot de
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, wwieser at gmx dot de
- Date: 9 Nov 2002 23:54:52 -0000
- Subject: Re: c++/8511: (hopefully) reproducible cc1plus SIGSEGV.
- Reply-to: reichelt at igpm dot rwth-aachen dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, wwieser at gmx dot de, gcc-gnats at gcc dot gnu dot org
Synopsis: (hopefully) reproducible cc1plus SIGSEGV.
State-Changed-From-To: open->analyzed
State-Changed-By: reichelt
State-Changed-When: Sat Nov 9 15:54:52 2002
State-Changed-Why:
Confirmed.
Compiling the code with gcc 3.2 I get an internal compiler error.
The problem can be reduced to the following code snippet:
------------------------snip here--------------------
template <int I> struct A
{
void foo();
template <int M,int N> friend int bar (const A<N>&, const A<M>&);
};
template <> void A<0>::foo() {}
template <int M,int N> int bar (const A<N>&, const A<M>&) { return N; }
void baz () { bar(A<1>(),A<2>()); }
------------------------snip here--------------------
Compiling this with gcc 3.2 (just "g++ -c") I get the
following ICE:
bug.cc: In function `int bar(const A<N>&, const A<M>&) [with int M = 2, int N
= 1, int I = 0]':
bug.cc:11: instantiated from here
bug.cc:9: Internal compiler error in c_expand_expr, at c-common.c:3646
Please submit a full bug report, [etc.]
In fact, the short testcase crashes gcc since 2.95.x.
The code looks illegal to me (foo is specialized without
having specialized A first).
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8511