This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19055] Minor bit optimization with or and xor
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Feb 2005 14:44:41 -0000
- Subject: [Bug tree-optimization/19055] Minor bit optimization with or and xor
- References: <20041217141606.19055.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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