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/19055] Minor bit optimization with or and xor


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-22 14:44 -------
If we changed the function in comment #0 like so:
int f(int a)
{
  a=(a|1)^1;
  return a;
}

Fold should do this simplification.

And likewise for comment #1 (which is just general case):
int f(int a,int b)
{
  a=(a|b) ^ b;
  return a;
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |19987
              nThis|                            |
          Component|rtl-optimization            |tree-optimization


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


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