[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#328119: marked as done (g++-4.0: Fails to build attached code unless optimisation level > 0)



Your message dated Tue, 13 Sep 2005 19:30:49 +0200
with message-id <87br2wc1ti.fsf@debian.org>
and subject line Bug#328119: g++-4.0: Fails to build attached code unless optimisation level > 0
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 13 Sep 2005 16:23:57 +0000
>From b-debbugs@blackham.com.au Tue Sep 13 09:23:57 2005
Return-path: <b-debbugs@blackham.com.au>
Received: from oracle.bridgewayconsulting.com.au [203.56.14.38] 
	by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
	id 1EFDZd-000582-00; Tue, 13 Sep 2005 09:23:57 -0700
Received: from amidala (dsl-202-72-159-76.wa.westnet.com.au [202.72.159.76])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by oracle.bridgewayconsulting.com.au (Postfix) with ESMTP id C7F3C2E8004;
	Wed, 14 Sep 2005 00:23:52 +0800 (WST)
Received: by amidala (Postfix, from userid 1000)
	id 10CAC2CE21; Wed, 14 Sep 2005 00:23:52 +0800 (WST)
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Bernard Blackham <b-debbugs@blackham.com.au>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: g++-4.0: Fails to build attached code unless optimisation level > 0
X-Mailer: reportbug 3.17
Date: Wed, 14 Sep 2005 00:23:51 +0800
Message-Id: <[🔎] 20050913162352.10CAC2CE21@amidala>
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02

Package: g++-4.0
Version: 4.0.1-6
Severity: important

This code gives fails to link unless compiled with optimisation. -O1,
-O2, -O3..., or -Os all compile fine, just -O0 bombs out with:

$ g++-4.0 buggered.cpp 
/tmp/cc25MWXo.o: In function `fp::operator>(fp const&) const':
buggered.cpp:(.gnu.linkonce.t._ZNK2fpgtERKS_[fp::operator>(fp const&) const]+0x5): undefined reference to `fp::e'
collect2: ld returned 1 exit status
$ g++-4.0 -O2 buggered.cpp 
$ 

buggered.cpp:
-- snip --
class fp {
        static const double e = 0.00001;
        double val;
public:
        fp(double val) : val(val) {}
        bool operator > (const fp& f) const { return e == 0; }
};

int main() {
        fp f(1), g(2);
        return f > g;
}
-- snip --

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.13
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages g++-4.0 depends on:
ii  gcc-4.0                       4.0.1-6    The GNU C compiler
ii  gcc-4.0-base                  4.0.1-6    The GNU Compiler Collection (base 
ii  libc6                         2.3.5-6    GNU C Library: Shared libraries an
ii  libstdc++6-4.0-dev            4.0.1-6    The GNU Standard C++ Library v3 (d

g++-4.0 recommends no packages.

-- no debconf information

---------------------------------------
Received: (at 328119-done) by bugs.debian.org; 13 Sep 2005 17:31:22 +0000
>From falk@debian.org Tue Sep 13 10:31:22 2005
Return-path: <falk@debian.org>
Received: from smtp06.web.de [217.72.192.224] 
	by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
	id 1EFEcr-00023l-00; Tue, 13 Sep 2005 10:31:22 -0700
Received: from [82.82.216.245] (helo=juist)
	by smtp06.web.de with asmtp (TLSv1:DES-CBC3-SHA:168)
	(WEB.DE 4.105 #317)
	id 1EFEcN-0005A0-00
	for 328119-done@bugs.debian.org; Tue, 13 Sep 2005 19:30:51 +0200
Received: from falk by juist with local (Exim 4.52)
	id 1EFEcL-0003lf-Ln
	for 328119-done@bugs.debian.org; Tue, 13 Sep 2005 19:30:49 +0200
To: 328119-done@bugs.debian.org
Subject: Re: Bug#328119: g++-4.0: Fails to build attached code unless
 optimisation level > 0
References: <[🔎] 20050913162352.10CAC2CE21@amidala>
From: Falk Hueffner <falk@debian.org>
X-Face: "iUeUu$b*W_"w?tV83Y3*r:`rh&dRv}$YnZ3,LVeCZSYVuf[Gpo*5%_=/\_!gc_,SS}[~xZ
 wY77I-M)xHIx:2f56g%/`SOw"Dx%4Xq0&f\Tj~>|QR|vGlU}TBYhiG(K:2<T^
Date: Tue, 13 Sep 2005 19:30:49 +0200
In-Reply-To: <[🔎] 20050913162352.10CAC2CE21@amidala> (Bernard Blackham's message
 of "Wed, 14 Sep 2005 00:23:51 +0800")
Message-ID: <87br2wc1ti.fsf@debian.org>
User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.5 (cilantro, linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Sender: falk@debian.org
X-Sender: falk.hueffner@web.de
Delivered-To: 328119-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02

Bernard Blackham <b-debbugs@blackham.com.au> writes:

> This code gives fails to link unless compiled with optimisation. -O1,
> -O2, -O3..., or -Os all compile fine, just -O0 bombs out with:
>
> $ g++-4.0 buggered.cpp 
> /tmp/cc25MWXo.o: In function `fp::operator>(fp const&) const':
> buggered.cpp:(.gnu.linkonce.t._ZNK2fpgtERKS_[fp::operator>(fp const&) const]+0x5): undefined reference to `fp::e'
> collect2: ld returned 1 exit status
> $ g++-4.0 -O2 buggered.cpp 
> $ 
>
> buggered.cpp:
> -- snip --
> class fp {
>         static const double e = 0.00001;
>         double val;
> public:
>         fp(double val) : val(val) {}
>         bool operator > (const fp& f) const { return e == 0; }
> };
>
> int main() {
>         fp f(1), g(2);
>         return f > g;
> }

This is not a bug. Static class members need to be defined in some
compilation unit.

-- 
	Falk



Reply to: