From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29863 invoked by alias); 15 Nov 2008 13:56:01 -0000 Received: (qmail 17403 invoked by uid 48); 15 Nov 2008 13:54:39 -0000 Date: Sat, 15 Nov 2008 13:56:00 -0000 Subject: [Bug c++/38132] New: std::string is faster with -D_GLIBCXX_DEBUG=1 than without X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "edwintorok at gmail dot com" 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: 2008-11/txt/msg01194.txt.bz2 basic_string.tcc contains 'extern template basic_string', which prevents the template from being instantiated, and thus all calls to basic_string methods remain calls even at -O3. If I -D_GLIBCXX_DEBUG=1 _GLIBCXX_EXTERN_TEMPLATE is 0, thus it will no longer contain 'extern template basic_string', so the body of methods will be available, and inlining will be performed. However _GLIBCXX_DEBUG=1 activates debug code, so I would like to be able to get the methods inlined w/o definining debug mode. Can the semantics of 'extern template' be changed [*] in such a way, that *if* the body of some of the methods are suitable for inlining, they will be inlined (and other methods won't get instantiated), and if none of the methods are suitable, the behaviour stays as currently. [*] by introducing a new compiler flag, that can be activated at -O3 (and maybe -O2) at the expense of code size. -- Summary: std::string is faster with -D_GLIBCXX_DEBUG=1 than without Product: gcc Version: 4.3.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: edwintorok at gmail dot com GCC build triplet: x86_64-linux-gnu GCC host triplet: x86_64-linux-gnu GCC target triplet: x86_64-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38132