Commit 0d99f8a0 by Richard Biener Committed by Richard Biener

re PR tree-optimization/71352 (ICE at -O1 and above on x86_64-linux-gnu: in…

re PR tree-optimization/71352 (ICE at -O1 and above on x86_64-linux-gnu: in zero_one_operation, at tree-ssa-reassoc.c:1251)

2016-05-31  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/71352
	* tree-ssa-reassoc.c (zero_one_operation): Handle op equal to
	minus one and a negate.

	* gcc.dg/tree-ssa/reassoc-45.c: New testcase.

From-SVN: r236920
parent a1293f40
2016-05-31 Richard Biener <rguenther@suse.de>
PR tree-optimization/71352
* tree-ssa-reassoc.c (zero_one_operation): Handle op equal to
minus one and a negate.
2016-05-31 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/aarch64/aarch64.c (aarch64_simd_attr_length_move): Delete.
......
2016-05-31 Richard Biener <rguenther@suse.de>
PR tree-optimization/71352
* gcc.dg/tree-ssa/reassoc-45.c: New testcase.
2016-05-31 Thomas Preud'homme <thomas.preudhomme@arm.com>
* gcc.target/arm/armv5_thumb_isa.c: New test.
......
/* PR/71352 */
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-reassoc1" } */
unsigned a, b, c, d, e;
void
fn1 ()
{
unsigned f;
e = f = d * -b + a * -c;
}
/* Check that we factor -1 and create -(d * b + a * c). */
/* { dg-final { scan-tree-dump-times " = -" 1 "reassoc1" } } */
......@@ -1199,12 +1199,21 @@ zero_one_operation (tree *def, enum tree_code opcode, tree op)
propagate_op_to_single_use (op, stmt, def);
return;
}
else if (gimple_assign_rhs_code (stmt) == NEGATE_EXPR
&& gimple_assign_rhs1 (stmt) == op)
else if (gimple_assign_rhs_code (stmt) == NEGATE_EXPR)
{
if (gimple_assign_rhs1 (stmt) == op)
{
propagate_op_to_single_use (op, stmt, def);
return;
}
else if (integer_minus_onep (op)
|| real_minus_onep (op))
{
gimple_assign_set_rhs_code
(stmt, TREE_CODE (gimple_assign_rhs1 (stmt)));
return;
}
}
}
name = gimple_assign_rhs1 (stmt);
......@@ -1238,12 +1247,21 @@ zero_one_operation (tree *def, enum tree_code opcode, tree op)
return;
}
else if (is_gimple_assign (stmt2)
&& gimple_assign_rhs_code (stmt2) == NEGATE_EXPR
&& gimple_assign_rhs1 (stmt2) == op)
&& gimple_assign_rhs_code (stmt2) == NEGATE_EXPR)
{
if (gimple_assign_rhs1 (stmt2) == op)
{
propagate_op_to_single_use (op, stmt2, def);
return;
}
else if (integer_minus_onep (op)
|| real_minus_onep (op))
{
gimple_assign_set_rhs_code
(stmt2, TREE_CODE (gimple_assign_rhs1 (stmt2)));
return;
}
}
}
/* Continue walking the chain. */
......
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