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]
Other format: [Raw text]

Re: c++/8511: (hopefully) reproducible cc1plus SIGSEGV.


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


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