public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/15826] don't use "if" to extract a single bit bit-field.
Date: Wed, 30 Apr 2008 19:22:00 -0000	[thread overview]
Message-ID: <20080430192144.29245.qmail@sourceware.org> (raw)
In-Reply-To: <bug-15826-5009@http.gcc.gnu.org/bugzilla/>



------- Comment #7 from rguenth at gcc dot gnu dot org  2008-04-30 19:21 -------
On the trunk I have after phiopt1:

;; Function andrew (andrew)

Removing basic block 3
Merging blocks 2 and 4
andrew (struct s * p)
{
  _Bool D.1212;
  int i;
  unsigned int D.1183;
  <unnamed-unsigned:1> D.1182;

<bb 2>:
  D.1182_3 = p_2(D)->bit;
  (void) 0;
  D.1212_9 = D.1182_3 != 0;
  i_10 = (int) D.1212_9;
  D.1183_6 = (unsigned int) i_10;
  return D.1183_6;

}

;; Function foo (foo)

Removing basic block 3
Merging blocks 2 and 4
foo (struct s * p)
{
  _Bool D.1199;
  unsigned int D.1177;
  <unnamed-unsigned:1> D.1176;

<bb 2>:
  D.1176_3 = p_2(D)->bit;
  (void) 0;
  D.1199_8 = D.1176_3 != 0;
  D.1177_9 = (unsigned int) D.1199_8;
  return D.1177_9;

}

which the next forwprop pass optimizes to

foo (struct s * p)
{
  unsigned int D.1177;
  <unnamed-unsigned:1> D.1176;

<bb 2>:
  D.1176_3 = p_2(D)->bit;
  D.1177_9 = D.1176_3 != 0;
  return D.1177_9;

}

andrew (struct s * p)
{
  unsigned int D.1183;
  <unnamed-unsigned:1> D.1182;

<bb 2>:
  D.1182_3 = p_2(D)->bit;
  D.1183_6 = D.1182_3 != 0;
  return D.1183_6;

}


-- 


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


  parent reply	other threads:[~2008-04-30 19:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-15826-5009@http.gcc.gnu.org/bugzilla/>
2006-03-02 14:24 ` pinskia at gcc dot gnu dot org
2007-04-05 21:01 ` steven at gcc dot gnu dot org
2008-04-30 19:22 ` rguenth at gcc dot gnu dot org [this message]
     [not found] <bug-15826-4@http.gcc.gnu.org/bugzilla/>
2012-01-24  0:55 ` pinskia at gcc dot gnu.org
2014-10-31  4:01 ` pinskia at gcc dot gnu.org
2014-12-01 14:07 ` rguenth at gcc dot gnu.org
2020-04-19 18:28 ` law at redhat dot com
2004-06-04 18:55 [Bug tree-optimization/15826] New: " kazu at cs dot umass dot edu
2004-06-04 19:07 ` [Bug tree-optimization/15826] " pinskia at gcc dot gnu dot org
2004-06-04 19:26 ` pinskia at gcc dot gnu dot org
2004-06-07 17:59 ` pinskia at gcc dot gnu dot org
2004-06-07 18:05 ` pinskia at gcc dot gnu dot org
2004-06-16  6:21 ` kazu at cs dot umass dot edu
2005-05-04  1:52 ` pinskia at gcc dot gnu dot 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=20080430192144.29245.qmail@sourceware.org \
    --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).