public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: Nikolaus Dunn <nikdunn1979@gmail.com>
Cc: gcc@gcc.gnu.org, gcc-help@gcc.gnu.org
Subject: Re: Optimization question
Date: Tue, 27 Sep 2016 15:20:00 -0000	[thread overview]
Message-ID: <87zimt5pza.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <c8204c33-7085-5dde-96f3-92d7745a0018@gmail.com> (Nikolaus Dunn's	message of "Tue, 27 Sep 2016 11:01:49 -0400")

* Nikolaus Dunn:

> I've run into an issue where turning on compiler optimization using
> -O1 or higher causes an issue in my program. Specifically, I am
> replacing the new and delete operators globally to perform some real
> time allocation tracking. When I compile with -O1 or -O2, my
> implementation of new is not being called by STL classes, via the
> std::allocator. My version of delete IS being called.

This matter is appropriate for the gcc-help list, redirecting there.

> I realize I may be doing something wrong and I've read many posts from
> people saying not to replace new and delete, but I'm hacking on a 15
> year old baseline. We've just stepped up to GCC 5.3.0 and are
> compiling with the -std=c++14 option (to give a little context). I'm
> also compiling using MinGW, but I'm figuring MinGW would be using the
> same optimization logic at the compiler level as pure GCC.

It's unclear whether this is an optimization issue, or a different
build issue.  We can't really comment on what's going wrong until you
have actual source code to show, I'm afraid.

Do you define your version of the global operators new and delete in
the same translation unit?

       reply	other threads:[~2016-09-27 15:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c8204c33-7085-5dde-96f3-92d7745a0018@gmail.com>
2016-09-27 15:20 ` Florian Weimer [this message]
2016-09-27 17:10   ` Jonathan Wakely
2016-09-27 17:39     ` Nikolaus Dunn
2016-09-27 17:49       ` Jonathan Wakely
2016-09-27 18:32       ` Florian Weimer
2016-09-28 10:13         ` Jonathan Wakely
2000-01-07 11:39 optimization question Igor Schein
2000-04-01  0:00 ` Igor Schein

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=87zimt5pza.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --cc=gcc-help@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=nikdunn1979@gmail.com \
    /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: link
Be 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).