public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: georgeh@aya.yale.edu To: gcc-gnats@gcc.gnu.org Subject: c++/6052: calls to allocator::~allocator made for empty class Date: Mon, 25 Mar 2002 07:36:00 -0000 [thread overview] Message-ID: <20020325152907.2655.qmail@sources.redhat.com> (raw) >Number: 6052 >Category: c++ >Synopsis: calls to allocator::~allocator made for empty class >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: pessimizes-code >Submitter-Id: net >Arrival-Date: Mon Mar 25 07:36:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: George Heintzelman <georgeh@aya.yale.edu> >Release: gcc-3.0.4 >Organization: >Environment: Solaris 2.8 >Description: In the following code: #include <string> int main() { for (int i = 0; i < 100000; ++i) { std::string foo("Hello world"); } } g++ generates calls to empty std::allocator::~allocator routines, as well as empty std::string::Alloc_hider::~Alloc_hider routines, within the loop. >How-To-Repeat: compile with g++ -O3 >Fix: (sort of) I can get rid of the calls by commenting out ~allocator() __STL_NOTHROW {} in the standard header stl_alloc.h. So I considered submitting this as a library bug (and the library probably ought to be changed)... but the compiler really ought to be able to figure this out. It's not the __STL_NOTHROW, either, leaving it as ~allocator() {} also causes the pessimizing behavior. >Release-Note: >Audit-Trail: >Unformatted:
next reply other threads:[~2002-03-25 15:36 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-03-25 7:36 georgeh [this message] 2002-04-07 9:33 jason 2003-01-22 21:22 bangerth 2003-01-23 15:46 George A. Heintzelman 2003-01-23 15:49 bangerth
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020325152907.2655.qmail@sources.redhat.com \ --to=georgeh@aya.yale.edu \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).