This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR opt/3995: Optimize (A&C)!=0 into A<0
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: roger at eyesopen dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 5 May 2002 10:37:09 -0400 (EDT)
- Subject: Re: [PATCH] PR opt/3995: Optimize (A&C)!=0 into A<0
- References: <Pine.LNX.4.33.0205041932550.31165-100000@www.eyesopen.com>
> 2002-05-04 Roger Sayle <roger@eyesopen.com>
> PR opt/3995.
> * fold-const.c (sign_bit_p): New function.
> (fold) [EQ_EXPR]: Use this to convert (A & C) == 0 into A >= 0 and
> (A & C) != 0 into A < 0, when constant C is the sign bit of A's type.
> Reapply fold when converting (A & C) == C into (A & C) != 0.
> (fold_binary_op_with_conditional_arg): Fix typo in comment.
You should add testcases in the gcc.c-torture/execute directory to
verify that all of the transformations produce correct code and run
properly.
--Kaveh
--
Kaveh R. Ghazi Director of Systems Architecture
ghazi@caip.rutgers.edu Qwest Global Services