This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12574] New: another unit-at-a-time bug?
- From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Oct 2003 02:18:48 -0000
- Subject: [Bug c++/12574] New: another unit-at-a-time bug?
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12574
Summary: another unit-at-a-time bug?
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: snyder at fnal dot gov
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
Here's another case where gcc 3.4 fails to emit a required function definition.
>From a quick look, it looks like all the existing unit-at-a-time PRs have
been closed, so i hope this isn't a duplicate.
When the source below is compiled at -O2 or above, there's a reference
to the function `A::foo', but the definition isn't emitted:
$ cc1plus -quiet -O2 x.cc
$ grep foo x.s
movl $_ZN1A3fooEv, (%eax)
$
Environment:
System: Linux karma 2.4.19-emp_2419p5a829i #1 Tue Sep 3 17:42:17 EST 2002 i686 i686 i386 GNU/Linux
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --prefix=/usr/local/gcc --enable-threads=posix --enable-long-long --enable-languages=c,c++,f77
How-To-Repeat:
Compile this with -O2 or above:
------------------------------------------------------------------------
struct A
{
static int foo() { return 0; }
};
template <class TYPE>
class C
{
public:
C ();
int (*f_)(void);
};
template <class TYPE>
C<TYPE>::C ()
: f_ (A::foo)
{
}
void open ()
{
C<int> th;
}
------------------------------------------------------------------------