From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26262 invoked by alias); 23 Sep 2011 10:11:19 -0000 Received: (qmail 26251 invoked by uid 22791); 23 Sep 2011 10:11:18 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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; Fri, 23 Sep 2011 10:11:04 +0000 From: "lukasz.filipkowski at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/38607] AIX error messages about TOC during build Date: Fri, 23 Sep 2011 10:14:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: lukasz.filipkowski at gmail dot com 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: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2011-09/txt/msg01625.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38607 Lukasz Filipkowski changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lukasz.filipkowski at gmail | |dot com --- Comment #15 from Lukasz Filipkowski 2011-09-23 10:10:58 UTC --- Hello, regarding ld: 0711-768 WARNING when compiling: > #include > #include > void foo() > { > std::map bar; > } into rtl-enabled shared library. Warning is caused by code construction similar to the one presented in the following example: //g++ -save-temps -shared -Wl,-G -o libshare.so share.cc #include #include using namespace std; template class MyClass { public: typedef Key KeyType; MyClass(KeyType aNumber) { cout << aNumber << "! = " << factorial(aNumber) << endl; } ~MyClass(){} private: long factorial(KeyType __x); long factorialHelper(KeyType __x); }; template long MyClass::factorial(KeyType __x) { if (__x <= 0) return 1; else return __x * factorial(__x-1); //else return __x * factorialHelper(__x-1); } template long MyClass::factorialHelper(KeyType __x) { return factorial(__x); } void foo() { MyClass myClass(5); } $ g++ -save-temps -shared -Wl,-G -o libshare.so share.cc ld: 0711-768 WARNING: Object share.o, section 1, function .MyClass::factorial(int): The branch at address 0x36c is not followed by a recognized no-op or TOC-reload instruction. The unrecognized instruction is 0x7C691B78. Example code is based on contents of stl_tree.h file in which class _Rb_tree is defined. Warning is generated in case creation of shared libraries using TEMPLATE CLASSES with RECURSIVE METHODS. In the presented example "factorial" method is a recursive one. When modifying: template long MyClass::factorial(KeyType __x) { if (__x <= 0) return 1; else return __x * factorial(__x-1); //else return __x * factorialHelper(__x-1); } into: template long MyClass::factorial(KeyType __x) { if (__x <= 0) return 1; //else return __x * factorial(__x-1); else return __x * factorialHelper(__x-1); } there is no linker warning. The _Rb_tree class, defined in stl_tree.h, contains _M_erase and _M_copy methods, both recursive. Warning is present when using both GCC4.4.5 and GCC4.6.1 on AIX 5300-11-03-1013 (AIX5.3 TL11 SP03) When using assembler program (as) from AIX 5300-08-02-0822 (AIX5.3 TL08 SP02) there is no warning generated. I'm not sure but problematic warning might be a result of fixes similar to https://www-304.ibm.com/support/docview.wss?uid=isg1IZ24688