This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/31261] Missed tree optimizations: (8 - (x & 7)) & 7
- From: "trt at acm dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Mar 2007 18:28:35 -0000
- Subject: [Bug tree-optimization/31261] Missed tree optimizations: (8 - (x & 7)) & 7
- References: <bug-31261-87@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from trt at acm dot org 2007-03-21 18:28 -------
I think this could be generalized to more operators, e.g.
(y | (x & 7)) & 7
^ (bitwise or, xor, multiply, ...)
This optimization could be for "e & M" where e contains a subexpression of the
form "t & N" which can (sometimes) be simplified to "t". I suppose that would
require walking the tree.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31261