This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/24990] New: fold should convert ~a == C to a == ~C where C is a constant


Take the following couple functions:
int f(int a)
{
  return (~a) != 0;
}

int f1(int a)
{
  return a != (~0);
}

int f2(int a)
{
  return (~a) != 1;
}

int f3(int a)
{
  return a != (~1);
}

f and f1 should be the same.  Likewise for f2 and f3.


-- 
           Summary: fold should convert ~a == C to a == ~C where C is a
                    constant
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, TREE
          Severity: enhancement
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]