+2015-03-09 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ PR tree-optimization/63743
+ * cfgexpand.c (reorder_operands): Also reorder if only second operand
+ had its definition forwarded by TER.
+
2015-03-08 Jan Hubicka <hubicka@ucw.cz>
PR lto/65316
continue;
/* Swap operands if the second one is more expensive. */
def0 = get_gimple_for_ssa_name (op0);
- if (!def0)
- continue;
def1 = get_gimple_for_ssa_name (op1);
if (!def1)
continue;
swap = false;
- if (lattice[gimple_uid (def1)] > lattice[gimple_uid (def0)])
+ if (!def0 || lattice[gimple_uid (def1)] > lattice[gimple_uid (def0)])
swap = true;
if (swap)
{
fprintf (dump_file, "Swap operands in stmt:\n");
print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
fprintf (dump_file, "Cost left opnd=%d, right opnd=%d\n",
- lattice[gimple_uid (def0)],
+ def0 ? lattice[gimple_uid (def0)] : 0,
lattice[gimple_uid (def1)]);
}
swap_ssa_operands (stmt, gimple_assign_rhs1_ptr (stmt),
+2015-03-09 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ PR tree-optimization/63743
+ * gcc.dg/pr63743.c: New test.
+
2015-03-08 Jan Hubicka <hubicka@ucw.cz>
PR lto/65316
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-rtl-expand-details" } */
+
+double
+libcall_dep (double x, double y)
+{
+ return x * (x + y);
+}
+
+/* { dg-final { scan-rtl-dump-times "Swap operands" 1 "expand" } } */
+/* { dg-final { cleanup-rtl-dump "expand" } } */