This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Committed] PR13827: Fold (X&C) != (Y&C) as ((X^Y)&C) != 0
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Roger Sayle <roger at eyesopen dot com>
- Date: Sun, 12 Nov 2006 19:54:10 +0100
- Subject: Re: [Committed] PR13827: Fold (X&C) != (Y&C) as ((X^Y)&C) != 0
- References: <Pine.LNX.4.44.0611121045590.31194-100000@www.eyesopen.com>
On Sunday 12 November 2006 18:57, Roger Sayle wrote:
> The following patch resolves the enhancement request PR tree-opt/13827.
> The optimization is to transform equality/inequality expressions such as
> "(X & 0xf0) == (Y & 0xf0)" into "((X ^ Y) & 0xf0) == 0". The belief is
> that these forms of expressions are frequent in testing flags and
> bitfields.
Belief... :-)
Have you checked whether (or how often) this triggers on gcc itself?
There are enough flag tests in GCC, so if this really is a common
expression, it should result in, I don't know, a smaller cc1, etc...?
Gr.
Steven