From d149d356890a9ef2a81f4f0708a8b46fb2656469 Mon Sep 17 00:00:00 2001 From: rguenth Date: Sun, 17 Feb 2008 14:00:48 +0000 Subject: 2008-02-17 Richard Guenther PR tree-optimization/35231 * tree-vrp.c (register_edge_assert_for): Do not assume A == 0 if A | B != 1. * gcc.c-torture/execute/pr35231.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132378 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vrp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/tree-vrp.c') diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 5f9a3279aa3..f9615d1f815 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -3753,7 +3753,11 @@ register_edge_assert_for (tree name, edge e, block_stmt_iterator si, tree cond) 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); -- cgit v1.2.1