public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [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; 2+ 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] 2+ messages in thread

end of thread, other threads:[~2005-04-21  0:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-21  0:47 [Bug tree-optimization/21137] New: Convert (a >> 2) & 1 != 0 into a & 4 != 0 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).