2015-02-26 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/65216
+ * tree-ssa-reassoc.c (rewrite_expr_tree): Force creation of
+ new stmt and new SSA_NAME for lhs whenever the arguments have
+ changed and weren't just swapped. Fix comment typo.
+
PR tree-optimization/65215
* tree-ssa-math-opts.c (find_bswap_or_nop_load): Return false
for PDP endian targets.
2015-02-26 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/65216
+ * gcc.c-torture/execute/pr65216.c: New test.
+
PR tree-optimization/65215
* gcc.c-torture/execute/pr65215-1.c: New test.
* gcc.c-torture/execute/pr65215-2.c: New test.
/* The final recursion case for this function is that you have
exactly two operations left.
- If we had one exactly one op in the entire list to start with, we
+ If we had exactly one op in the entire list to start with, we
would have never called this function, and the tail recursion
rewrites them one at a time. */
if (opindex + 2 == ops.length ())
print_gimple_stmt (dump_file, stmt, 0, 0);
}
- if (changed)
+ /* Even when changed is false, reassociation could have e.g. removed
+ some redundant operations, so unless we are just swapping the
+ arguments or unless there is no change at all (then we just
+ return lhs), force creation of a new SSA_NAME. */
+ if (changed || ((rhs1 != oe2->op || rhs2 != oe1->op) && opindex))
{
gimple insert_point = find_insert_point (stmt, oe1->op, oe2->op);
lhs = make_ssa_name (TREE_TYPE (lhs));