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 tree-optimization/15458] New: Combine ~ and ^.


unsigned int
xornot (unsigned int a)
{
  unsigned int b = a ^ 0xffff;
  unsigned int c = ~b;
  return c;
}

unsigned int
notxor (unsigned int a)
{
  unsigned int b = ~a;
  unsigned int c = b ^ 0xffff;
  return c;
}

The last tree-ssa form looks like:

;; Function xornot (xornot)

xornot (a)
{
  unsigned int c;
  unsigned int b;

<bb 0>:
  b_2 = a_1 ^ 65535;
  c_3 = ~b_2;
  return c_3;

}



;; Function notxor (notxor)

notxor (a)
{
  unsigned int c;
  unsigned int b;

<bb 0>:
  b_2 = ~a_1;
  c_3 = b_2 ^ 65535;
  return c_3;

}

-- 
           Summary: Combine ~ and ^.
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: pessimizes-code
          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=15458


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