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: [PATCH] PR opt/3995: Optimize (A&C)!=0 into A<0


 > 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


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