From: Thomas Preud'homme Date: Mon, 9 Mar 2015 01:31:42 +0000 (+0000) Subject: re PR middle-end/63743 (Thumb1: big regression for float operators by r216728) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=68ca4ac90b7413e7007ae6b08d372205e42bdb7d;p=gcc.git re PR middle-end/63743 (Thumb1: big regression for float operators by r216728) 2015-03-09 Thomas Preud'homme gcc/ PR tree-optimization/63743 * cfgexpand.c (reorder_operands): Also reorder if only second operand had its definition forwarded by TER. gcc/testsuite/ PR tree-optimization/63743 * gcc.dg/pr63743.c: New test. From-SVN: r221276 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4c97e87b950..07430ae567a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-03-09 Thomas Preud'homme + + 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 PR lto/65316 diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 569cd0d2390..93d894f3741 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -5124,13 +5124,11 @@ reorder_operands (basic_block bb) 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) { @@ -5139,7 +5137,7 @@ reorder_operands (basic_block bb) 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), diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 50fc5d64d9e..8256fc3d9a6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-09 Thomas Preud'homme + + PR tree-optimization/63743 + * gcc.dg/pr63743.c: New test. + 2015-03-08 Jan Hubicka PR lto/65316 diff --git a/gcc/testsuite/gcc.dg/pr63743.c b/gcc/testsuite/gcc.dg/pr63743.c new file mode 100644 index 00000000000..87254edbde1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr63743.c @@ -0,0 +1,11 @@ +/* { 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" } } */