Commit 22e63bd3 by Roger Sayle Committed by Roger Sayle

fold-const.c (tree_expr_nonnegative_p): Handle BIT_XOR_EXPR like BIT_IOR_EXPR...


	* fold-const.c (tree_expr_nonnegative_p): Handle BIT_XOR_EXPR like
	BIT_IOR_EXPR; A^B is nonnegative when A and B are nonnegative.

	* gcc.dg/compare8.c: Add an additional test for XOR.

From-SVN: r79979
parent 0066ef9c
2004-03-25 Roger Sayle <roger@eyesopen.com>
* fold-const.c (tree_expr_nonnegative_p): Handle BIT_XOR_EXPR like
BIT_IOR_EXPR; A^B is nonnegative when A and B are nonnegative.
2004-03-25 Richard Henderson <rth@redhat.com>
PR 11527
......
......@@ -8722,6 +8722,7 @@ tree_expr_nonnegative_p (tree t)
return tree_expr_nonnegative_p (TREE_OPERAND (t, 1))
|| tree_expr_nonnegative_p (TREE_OPERAND (t, 0));
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
return tree_expr_nonnegative_p (TREE_OPERAND (t, 0))
&& tree_expr_nonnegative_p (TREE_OPERAND (t, 1));
......
2004-03-25 Roger Sayle <roger@eyesopen.com>
* gcc.dg/compare8.c: Add an additional test for XOR.
2004-03-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/torture/builtin-ctype-1.c: New test.
......
......@@ -13,3 +13,9 @@ g(unsigned short a1, unsigned short a2, unsigned int b)
return ((a1+a2)&5) > b ? 2 : 3; /* { dg-bogus "signed and unsigned" } */
}
int
h(unsigned short a1, unsigned short a2, unsigned int b)
{
return ((a1+a2)^5) > b ? 2 : 3; /* { dg-bogus "signed and unsigned" } */
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment