This is the mail archive of the gcc-patches@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]

Re: [Committed] PR13827: Fold (X&C) != (Y&C) as ((X^Y)&C) != 0


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


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