public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "segher at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/15596] [4.8/4.9/5 Regression] Missed optimization with bitfields with return value
Date: Sun, 01 Feb 2015 07:33:00 -0000	[thread overview]
Message-ID: <bug-15596-4-vVRT1nbMBM@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-15596-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15596

Segher Boessenkool <segher at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |segher at gcc dot gnu.org

--- Comment #25 from Segher Boessenkool <segher at gcc dot gnu.org> ---
If you initialise the return value to all zeroes, the good code comes
out again.  The problem is that currently GCC preserves all padding
bits.  The same is true for normal stores (instead of return value via
hidden pointer as in the example code).

For this case, for PowerPC, writing 0 to all padding bits is optimal.
That is because we write to field "d" which is adjacent to the padding
bits, and we do the access as a 32-bit word anyway.  For other cases
(and other targets, and other ABIs) things will be different.


  parent reply	other threads:[~2015-02-01  7:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-15596-4@http.gcc.gnu.org/bugzilla/>
2011-05-06 13:21 ` [Bug tree-optimization/15596] [4.3/4.4/4.5/4.6/4.7 " rguenth at gcc dot gnu.org
2011-06-27 14:01 ` rguenth at gcc dot gnu.org
2012-03-13 14:21 ` [Bug tree-optimization/15596] [4.5/4.6/4.7/4.8 " jakub at gcc dot gnu.org
2012-07-02 12:37 ` [Bug tree-optimization/15596] [4.6/4.7/4.8 " rguenth at gcc dot gnu.org
2013-04-12 15:21 ` [Bug tree-optimization/15596] [4.7/4.8/4.9 " jakub at gcc dot gnu.org
2014-06-12 13:46 ` [Bug tree-optimization/15596] [4.7/4.8/4.9/4.10 " rguenth at gcc dot gnu.org
2014-12-19 13:28 ` [Bug tree-optimization/15596] [4.8/4.9/5 " jakub at gcc dot gnu.org
2015-02-01  7:33 ` segher at gcc dot gnu.org [this message]
2015-06-23  8:25 ` [Bug tree-optimization/15596] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
2015-06-26 19:58 ` [Bug tree-optimization/15596] [4.9/5/6 " jakub at gcc dot gnu.org
2015-06-26 20:29 ` jakub at gcc dot gnu.org
2021-04-27 11:37 ` [Bug tree-optimization/15596] [8/9/10/11/12 " jakub at gcc dot gnu.org
2021-07-28  7:04 ` [Bug tree-optimization/15596] [9/10/11/12 " rguenth at gcc dot gnu.org
2022-04-21  7:47 ` rguenth at gcc dot gnu.org
2023-05-29 10:01 ` [Bug tree-optimization/15596] [10/11/12/13/14 " jakub 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=bug-15596-4-vVRT1nbMBM@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).