Subject: toolchain/15405: g++ internal error
To: None <gnats-bugs@gnats.netbsd.org>
From: Andreas Gustafsson <gson@nominum.com>
List: netbsd-bugs
Date: 01/28/2002 09:55:02
>Number:         15405
>Category:       toolchain
>Synopsis:       g++ internal error
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 28 09:56:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Andreas Gustafsson
>Release:        NetBSD 1.5Z
>Organization:
Nominum Inc
>Environment:
System: NetBSD guava.araneus.fi 1.5Z NetBSD 1.5Z (GUAVA) #0: Thu Jan 17 19:19:55 PST 2002 gson@guava.araneus.fi:/usr/src/sys/arch/i386/compile/GUAVA i386
Architecture: i386
Machine: i386
>Description:
When I try to compile a certain C++ program under NetBSD-current, g++
exits with an internal error.  This happens only with the gcc 2.95.3
based compiler that comes with -current; neither gcc 2.91 (in an earlier
NetBSD-current), gcc 2.96 (which comes with a certain other operating
system), nor Comeau C++ (a commercial third-party compiler) has any
problem compiling this code.

>How-To-Repeat:

Execute the shell commands

  cat >test.cc <<EOF
  int t(char *, char *);
  template <class K>
  struct H {
	  typedef int t;
  };
  template <class K>
  struct X {
	  typedef H<K>::t t;
	  void g(t);
  };
  EOF
  cc -c test.cc

and see the error message

  test.cc:9: Internal compiler error 61.
  test.cc:9: Please submit a full bug report.
  test.cc:9: See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

>Fix:

Upgrade to gcc 2.96 or newer.
>Release-Note:
>Audit-Trail:
>Unformatted: