summaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorthopre01 <thopre01@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-09 01:31:42 +0000
committerthopre01 <thopre01@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-09 01:31:42 +0000
commit4b8069b91bda2547201d4e26a74f88fa0fa09587 (patch)
tree470809846ffc5e7e1097aca2bab964a3faa37b96 /gcc/cfgexpand.c
parent86f5465f9134bc9aabf063207fc7dec1544233ce (diff)
downloadgcc-4b8069b91bda2547201d4e26a74f88fa0fa09587.tar.gz
2015-03-09 Thomas Preud'homme <thomas.preudhomme@arm.com>
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221276 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c6
1 files changed, 2 insertions, 4 deletions
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),