public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rearnsha at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/50883] [ARM] Suboptimal optimization for small structures
Date: Thu, 27 Oct 2011 16:53:00 -0000	[thread overview]
Message-ID: <bug-50883-4-9e9Txtn6iu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50883-4@http.gcc.gnu.org/bugzilla/>

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

Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
                 CC|                            |rearnsha at gcc dot gnu.org

--- Comment #6 from Richard Earnshaw <rearnsha at gcc dot gnu.org> 2011-10-27 16:53:07 UTC ---
So for PPC, this seems to be a lucky side-effect of the way the PPC ABI is
defined.  On PPC the argument is passed by reference and the compiler generates
an initial load expression of X from memory (a callee copy).  The RTL
optimization passes are then (in combination with the subreg splitting code)
able to notice, somehow, that this is equivalent to the final result and to
make use of it.

On ARM the structure is passed by value and the argument expanding code
immediately tries to store a copy into the stack.  Then, rather than seeing
that this could be used from a register value it tries to work solely with the
stack copy.

I notice that neither architecture optimizes this if the struct is passed as an
address rather than by value.


  parent reply	other threads:[~2011-10-27 16:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-27 11:55 [Bug target/50883] New: " sebastian.huber@embedded-brains.de
2011-10-27 11:56 ` [Bug target/50883] " sebastian.huber@embedded-brains.de
2011-10-27 11:58 ` sebastian.huber@embedded-brains.de
2011-10-27 11:58 ` sebastian.huber@embedded-brains.de
2011-10-27 14:51 ` rguenth at gcc dot gnu.org
2011-10-27 15:20 ` sebastian.huber@embedded-brains.de
2011-10-27 16:53 ` rearnsha at gcc dot gnu.org [this message]
2022-02-04  0:50 ` pinskia at gcc dot gnu.org
2022-02-04  0:50 ` pinskia at gcc dot gnu.org
2022-02-04 11:05 ` rearnsha at gcc dot gnu.org
2022-02-04 11:11 ` pinskia at gcc dot gnu.org
2022-02-04 11:30 ` rguenth at gcc dot gnu.org
2022-02-04 11:45 ` ebotcazou at gcc dot gnu.org
2022-02-04 11:58 ` rguenther at suse dot de
2022-02-04 12:24 ` ebotcazou at gcc dot gnu.org
2022-02-04 12:27 ` rearnsha at gcc dot gnu.org
2022-02-04 12:29 ` rearnsha at gcc dot gnu.org
2022-02-04 12:55 ` ebotcazou at gcc dot gnu.org
2022-02-04 16:29 ` sebastian.huber@embedded-brains.de

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=bug-50883-4-9e9Txtn6iu@http.gcc.gnu.org/bugzilla/ \
    --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).