This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/40056] implicit instantiation of function templates fails with -O2, works with -O and -g...
- From: "bircoph at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 08 Mar 2012 14:28:48 +0000
- Subject: [Bug c++/40056] implicit instantiation of function templates fails with -O2, works with -O and -g...
- Auto-submitted: auto-generated
- References: <bug-40056-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40056
Andrew Savchenko <bircoph at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bircoph at gmail dot com
--- Comment #5 from Andrew Savchenko <bircoph at gmail dot com> 2012-03-08 14:28:48 UTC ---
The problem is still here with gcc-4.5.3 if compiled with -O3:
x86_64-pc-linux-gnu-gcc -O -march=core2 -m64 -c TStreamerInfoReadBuffer.cxx -o
TStreamerInfoReadBuffer-1.o
x86_64-pc-linux-gnu-gcc -O2 -march=core2 -m64 -c TStreamerInfoReadBuffer.cxx -o
TStreamerInfoReadBuffer-2.o
x86_64-pc-linux-gnu-gcc -O3 -march=core2 -m64 -c TStreamerInfoReadBuffer.cxx -o
TStreamerInfoReadBuffer-1.o
nm TStreamerInfoReadBuffer-1.o | grep
_ZN13TStreamerInfo10ReadBufferIPPcEEiR7TBufferRKT_iiii
0000000000000000 W _ZN13TStreamerInfo10ReadBufferIPPcEEiR7TBufferRKT_iiii
nm TStreamerInfoReadBuffer-2.o | grep
_ZN13TStreamerInfo10ReadBufferIPPcEEiR7TBufferRKT_iiii
0000000000000000 W _ZN13TStreamerInfo10ReadBufferIPPcEEiR7TBufferRKT_iiii
nm TStreamerInfoReadBuffer-3.o | grep
_ZN13TStreamerInfo10ReadBufferIPPcEEiR7TBufferRKT_iiii
0000000000007b10 t
_ZN13TStreamerInfo10ReadBufferIPPcEEiR7TBufferRKT_iiii.clone.26
The guilty is -fipa-cp-clone option. Without it symbol is defined well:
x86_64-pc-linux-gnu-gcc -O3 -fno-ipa-cp-clone -march=core2 -m64 -c
TStreamerInfoReadBuffer.cxx -o TStreamerInfoReadBuffer-3-fipa-cp-clone.o
nm TStreamerInfoReadBuffer-3-fipa-cp-clone.o | grep
_ZN13TStreamerInfo10ReadBufferIPPcEEiR7TBufferRKT_iiii
0000000000000000 W _ZN13TStreamerInfo10ReadBufferIPPcEEiR7TBufferRKT_iiii