Commit e09deb14 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/35231 (VRP miscompiles libX11)

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.

From-SVN: r132378
parent e6528d32
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.
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;
}
......@@ -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);
......
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