OSDN Git Service

PR opt/3995
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 May 2002 22:59:38 +0000 (22:59 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 May 2002 22:59:38 +0000 (22:59 +0000)
commit203a24c48cbfcda34d7d513914e2bad55c062925
tree42a44a69dbd2f8b714055533a4e34ddf161eabd9
parent318fdd81915678cdc4e744ad9aa51cbfef2b9fc1
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.

testsuite/
* gcc.c-torture/execute/20020506-1.c: New test case.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53241 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20020506-1.c [new file with mode: 0644]