From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13432 invoked by alias); 4 Oct 2010 13:59:08 -0000 Received: (qmail 13225 invoked by uid 22791); 4 Oct 2010 13:59:07 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_CX,TW_GX X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Oct 2010 13:59:03 +0000 From: "r.menges at nice2cu dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/45880] New: Template-Methode in Shared Object not resolved when compiled with -O2 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: r.menges at nice2cu dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 04 Oct 2010 13:59:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-10/txt/msg00330.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45880 Summary: Template-Methode in Shared Object not resolved when compiled with -O2 Product: gcc Version: 4.3.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: r.menges@nice2cu.de Compiling the application with -O2 crashes the application because of a symbol-not-defined-error, while compiling without -O2 Option or using -g works. Actually I am overloading and not specializing an template-methode, which is propabily not the right way, but the example is trivial and because the application crashes when compiled with -O2 and not when compiled with -g or without the -O2 option i decided to send this bugreport. System is uname -a Linux dev 2.6.31-gentoo-r10 #1 SMP Mon Mar 8 21:00:17 CET 2010 i686 AMD Athlon(tm) XP 3000+ AuthenticAMD GNU/Linux and g++ -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.3.4 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.4 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.4/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.4/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --disable-fixed-point --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --disable-libgomp --with-arch=i686 --enable-languages=c,c++,java,treelang --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.4 p1.1, pie-10.1.5' Thread model: posix gcc version 4.3.4 (Gentoo 4.3.4 p1.1, pie-10.1.5) The tarBall contains the minimal-exmaple (source of shared libary and executable), compiler output and short description