public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
[parent not found: <bug-21137-5009@http.gcc.gnu.org/bugzilla/>]
* [Bug tree-optimization/21137] New: Convert (a >> 2) & 1 != 0 into a & 4 != 0
@ 2005-04-21  0:47 kazu at cs dot umass dot edu
  2005-04-21  0:50 ` [Bug middle-end/21137] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 10+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-04-21  0:47 UTC (permalink / raw)
  To: gcc-bugs

At tree level, we would like to canonicalize (a >> 2) & 1 != 0 into a & 4 != 0.

Currently,

void bar (void);

void
foo (int a)
{
  if ((a >> 2) & 1)
    bar ();
}

turns into

foo (a)
{
  int D.1235;
  int D.1236;
  _Bool D.1237;

  D.1235 = a >> 2;
  D.1236 = D.1235 & 1;
  D.1237 = (_Bool) D.1236;
  if (D.1237)
    {
      bar ();
    }
  else
    {
      
    }
}

-- 
           Summary: Convert (a >> 2) & 1 != 0 into a & 4 != 0
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kazu at cs dot umass dot edu
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-07-30  1:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20050421004702.21137.kazu@gcc.gnu.org>
2005-07-11  4:16 ` [Bug middle-end/21137] Convert (a >> 2) & 1 != 0 into a & 4 != 0 phython at gcc dot gnu dot org
2005-08-14 19:17 ` roger at eyesopen dot com
2005-08-14 21:56 ` phython at gcc dot gnu dot org
     [not found] <bug-21137-5009@http.gcc.gnu.org/bugzilla/>
2006-02-26 15:37 ` sayle at gcc dot gnu dot org
2006-02-26 18:47 ` roger at eyesopen dot com
2007-07-24 14:57 ` rask at sygehus dot dk
2007-07-24 15:00 ` rask at sygehus dot dk
2007-07-26  9:34 ` rask at gcc dot gnu dot org
2007-07-30  1:47 ` pinskia at gcc dot gnu dot org
2005-04-21  0:47 [Bug tree-optimization/21137] New: " kazu at cs dot umass dot edu
2005-04-21  0:50 ` [Bug middle-end/21137] " pinskia at gcc dot gnu dot org

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).