public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/15596] [4.3/4.4/4.5/4.6/4.7 Regression] Missed optimization with bitfields with return value
Date: Fri, 06 May 2011 13:21:00 -0000	[thread overview]
Message-ID: <bug-15596-4-mwpQ4MX0pi@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-15596-4@http.gcc.gnu.org/bugzilla/>

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |ASSIGNED
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #19 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-06 13:18:31 UTC ---
Even with bitfield accesses lowered at the tree level we end up with

<bb 2>:
  D.1736_2 = (<unnamed-signed:20>) s_1(D);
  BF.0_3 = MEM[(struct bitstr *)&<retval>];
  D.1741_4 = BF.0_3 & -1048576;
  D.1742_5 = (<unnamed-unsigned:20>) D.1736_2;
  D.1743_6 = (int) D.1742_5;
  BF.0_7 = D.1741_4 | 1048576;
  BF.1_9 = BF.0_7 | D.1743_6;
  D.1737_13 = (signed char) l_12(D);
  D.1738_14 = (<unnamed-signed:1>) D.1737_13;
  D.1747_16 = BF.1_9 & -6291457;
  D.1748_17 = (<unnamed-unsigned:1>) D.1738_14;
  D.1749_18 = (int) D.1748_17;
  D.1750_19 = D.1749_18 << 22;
  BF.3_20 = D.1750_19 | D.1747_16;
  MEM[(struct bitstr *)&<retval>] = BF.3_20;
  return <retval>;

there's some optimization possibilities if we can recognize the truncating
and extending conversions as bit manipulations.


       reply	other threads:[~2011-05-06 13:21 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 ` rguenth at gcc dot gnu.org [this message]
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
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-mwpQ4MX0pi@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).