+2008-02-17 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/35231
+ * tree-vrp.c (register_edge_assert_for): Do not assume A == 0
+ if A | B != 1.
+
2008-02-17 Uros Bizjak <ubizjak@gmail.com>
Revert:
+2008-02-17 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/35231
+ * gcc.c-torture/execute/pr35231.c: New testcase.
+
2008-02-17 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/pr32268.c (test_lt): Add noinline attribute.
--- /dev/null
+extern void abort(void);
+
+int __attribute__((noinline))
+foo(int bits_per_pixel, int depth)
+{
+ if ((bits_per_pixel | depth) == 1)
+ abort ();
+ return bits_per_pixel;
+}
+
+int main()
+{
+ if (foo(2, 0) != 2)
+ abort ();
+ return 0;
+}
if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
&& (TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == TRUTH_OR_EXPR
- || TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == BIT_IOR_EXPR))
+ /* For BIT_IOR_EXPR only if NAME == 0 both operands have
+ necessarily zero value. */
+ || (comp_code == EQ_EXPR
+ && (TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1))
+ == BIT_IOR_EXPR))))
{
tree op0 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 0);
tree op1 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 1);