public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/52267] New: a&~N where N has all the bits set up till a specific point can be folded to ((unsigned)a) < N
@ 2012-02-16  3:51 pinskia at gcc dot gnu.org
  2012-02-16 20:40 ` [Bug tree-optimization/52267] " pinskia at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-16  3:51 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52267
           Summary: a&~N where N has all the bits set up till a specific
                    point can be folded to ((unsigned)a) < N
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pinskia@gcc.gnu.org


Take the following two functions.
int f(int a, int b)
{
  if (a>3||a<0) return a;
  a&=3;
  return a&3;
}

int f1(int a)
{
  if (a&~03)  return a;
  return a&3;
}

They should return just the argument.  Right now the first function does but
not the second.


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

end of thread, other threads:[~2013-07-04 16:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-16  3:51 [Bug tree-optimization/52267] New: a&~N where N has all the bits set up till a specific point can be folded to ((unsigned)a) < N pinskia at gcc dot gnu.org
2012-02-16 20:40 ` [Bug tree-optimization/52267] " pinskia at gcc dot gnu.org
2012-03-09  4:15 ` pinskia at gcc dot gnu.org
2012-03-09 17:53 ` jakub at gcc dot gnu.org
2012-03-13 17:58 ` jakub at gcc dot gnu.org
2012-03-15 10:43 ` jakub at gcc dot gnu.org
2012-03-15 12:15 ` jakub at gcc dot gnu.org
2012-03-22 12:53 ` gjl at gcc dot gnu.org
2013-06-29 16:21 ` amylaar at gcc dot gnu.org
2013-06-29 16:24 ` pinskia at gcc dot gnu.org
2013-06-29 20:08 ` amylaar at gcc dot gnu.org
2013-07-04 16:20 ` amylaar at gcc dot gnu.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).