NetBSD Problem Report #36164

From martin@duskware.de  Tue Apr 17 15:15:38 2007
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 73CBF63B964
	for <gnats-bugs@gnats.netbsd.org>; Tue, 17 Apr 2007 15:15:38 +0000 (UTC)
Message-Id: <20070417150456.6271D63BA19@narn.NetBSD.org>
Date: Tue, 17 Apr 2007 15:04:56 +0000 (UTC)
From: labau@gmail.com
Reply-To: labau@gmail.com
To: gnats-bugs@NetBSD.org
Subject: G++ 4.1.2 internal segfault (ICE)  
X-Send-Pr-Version: www-1.0

>Number:         36164
>Category:       bin
>Synopsis:       G++ 4.1.2 internal segfault (ICE)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 17 15:20:00 +0000 2007
>Closed-Date:    Tue Nov 27 20:13:47 +0000 2018
>Last-Modified:  Tue Nov 27 20:13:47 +0000 2018
>Originator:     Mickael Labau
>Release:        3.0.1
>Organization:
none, personal use only
>Environment:
NetBSD solo 3.0.1 NetBSD 3.0.1 (GENERIC-FLOP-SM-BOOTLAN) #6: Thu Aug 10 16:04:04 CEST 2006  root@dt:/usr/src/sys/arch/i386/compile/GENERIC-FLOP-SM-BOOTLAN i386

>Description:
G++ 4.1.2 gives an Internal Compiler Error (ICE)
(class "ice-on-legal-code")
on this snippet (see "How to repeat this problem")

__FUNCTION__ or static method cause internal segfault
>How-To-Repeat:
// Version g++ 4.1.2

class CLASS
{
  // If i remove this line it works
  static unsigned long& OneVar()
  { static unsigned long v = 0; return v; }

public:

  template<typename Ty>
  static const Ty& Get(const char * const function,
                       const Ty default_value)
  {
    return default_value;
  }
};

bool run(int& stat)
{
  // If i replace __FUNCTION__ by __PRETTY_FUNCTION__ it works !
  for (int i = CLASS::Get<int>(__FUNCTION__, 100); i; --i)
    return true;
}

int main()
{
}

>Fix:
replace __FUNCTION__ by __PRETTY_FUNCTION__
OR
remove the static method

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 27 Nov 2018 20:13:47 +0000
State-Changed-Why:
Looks like GCC upstream has fixed this.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.