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]

optimization/6966: missing symbol for instantiate template with -O3


>Number:         6966
>Category:       optimization
>Synopsis:       template instance symbol missing with -O3
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 07 14:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        3.0.4
>Organization:
Algorithmics Inc.
>Environment:
System: Linux smaug 2.4.7-10smp #1 SMP Thu Sep 6 17:09:31 EDT 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../../source/gcc-3.0.4/configure --prefix=/mnts/cdstools/gcc-3.0.4/linux-i386-2.2 --enable-threads=posix --with-gnu-as --with-as=/mnts/cdstools/binutils-2.11.2/linux-i386-2.2/bin/as --with-gnu-ld --with-ld=/mnts/cdstools/binutils-2.11.2/linux-i386-2.2/bin/ld --with-local-prefix=/mnts/cdstools/linux-i386-2.2
>Description:
when using the std::map class, the non-const version of method
_Rb_tree::find is missing in the object file when compiled with -O3,
consequently leading to a linker error.
>How-To-Repeat:
This is the content of the source file x.cc:
#include <map>
template class std::map<int,void *>;

g++ -c -O2 -o good.o x.cc
g++ -c -O3 -o bad.o x.cc
nm -CA good.o bad.o | grep ::find | grep _Rb_tree

good.o has two version of _Rb_tree::find defined, while bad.o only has
one.

>Fix:
have yet to find a work around.

>Release-Note:
>Audit-Trail:
>Unformatted:


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