summaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-17 14:00:48 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-17 14:00:48 +0000
commitd149d356890a9ef2a81f4f0708a8b46fb2656469 (patch)
treeb460ac23b8786521d83cd102316a7ba02bde87cf /gcc/tree-vrp.c
parenta3c40304c2151604138b38e2b482e6ab1cd5960d (diff)
downloadgcc-d149d356890a9ef2a81f4f0708a8b46fb2656469.tar.gz
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. * 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
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c6
1 files changed, 5 insertions, 1 deletions
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);