public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/46228] code produced for STL container is worse in 4.5.1 than in 4.4.5
Date: Fri, 29 Oct 2010 20:42:00 -0000	[thread overview]
Message-ID: <20101029204200.2ZUo651rPpttAsBwbAvh_Bi4Dxk9tQPjCZg92a6aub8@z> (raw)
In-Reply-To: <bug-46228-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46228

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
           Severity|normal                      |enhancement

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-10-29 20:42:41 UTC ---
Considering std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::~_Rb_tree() [with _Key = int, _Val = int, _KeyOfValue =
std::_Identity<int>, _Compare = std::less<int>, _Alloc = std::allocator<int>]
with 4 size
 to be inlined into int main() in
/home/apinski/local-gcc/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/stl_set.h:87
 Estimated growth after inlined into all callees is +2 insns.
 Estimated badness is 3, frequency 1.00.
 inline_failed:call is unlikely and code size would grow.

...
Considering std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::~_Rb_tree() [with _Key = int, _Val = int, _KeyOfValue =
std::_Identity<int>, _Compare = std::less<int>, _Alloc = std::allocator<int>]
with 4 size
 to be inlined into int main() in
/home/apinski/local-gcc/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../include/c++/4.6.0/bits/stl_set.h:87
 Estimated growth after inlined into all callees is +2 insns.
 Estimated badness is 118, frequency 0.00.
 inline_failed:call is unlikely and code size would grow.


I bet we don't take into account that the argument to ~_Rb_tree is an
ADDR_EXPR.  First I noticed it saying the call is unlikely which is true but
the thing that is not true is the +2 insns; only because of the arguments being
passed is an ADDR_EXPR of a component_ref of a var_decl.  Maybe we should
record if the only places pointer arguments are used is in
MEM_REF/INDIRECT_REF's and then inline functions based on that fact if we have
those arguments as a ADDR_EXPR of a decl.


  parent reply	other threads:[~2010-10-29 20:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-29 16:58 [Bug tree-optimization/46228] New: " zeev.tarantov at gmail dot com
2010-10-29 19:00 ` [Bug tree-optimization/46228] " hjl.tools at gmail dot com
2010-10-29 20:30 ` paolo.carlini at oracle dot com
2010-10-29 20:42 ` pinskia at gcc dot gnu.org [this message]
2010-10-29 20:44 ` pinskia at gcc dot gnu.org
2010-10-29 23:28 ` rguenth at gcc dot gnu.org
2010-10-29 23:45 ` zeev.tarantov at gmail dot com
2010-10-30 15:41 ` hubicka at gcc dot gnu.org
2010-10-30 16:00 ` hubicka at gcc dot gnu.org
2010-10-30 20:06 ` zeev.tarantov at gmail dot com
2010-11-04  4:44 ` hubicka at gcc dot gnu.org
2010-11-04 17:32 ` hubicka at gcc dot gnu.org
2010-11-10 20:11 ` hubicka at gcc dot gnu.org
2010-11-10 20:23 ` hubicka at gcc dot gnu.org
2010-11-10 20:27 ` hubicka at gcc dot gnu.org
2010-11-11  0:43 ` zeev.tarantov at gmail dot com
2021-12-28  3:56 ` [Bug ipa/46228] " pinskia at gcc dot gnu.org

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=20101029204200.2ZUo651rPpttAsBwbAvh_Bi4Dxk9tQPjCZg92a6aub8@z \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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: 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).