From a0aeb7fb93da156b64fd08391c79ff35a69af7ba Mon Sep 17 00:00:00 2001 From: Joern Rennecke Date: Tue, 9 Jul 2019 21:55:31 +0000 Subject: [PATCH] tree-vect-stmts.c (vectorizable_comparison): Swap operands only once. * tree-vect-stmts.c (vectorizable_comparison) : Swap operands only once. From-SVN: r273316 --- gcc/ChangeLog | 5 +++++ gcc/tree-vect-stmts.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 71569bfa4d6..4ae2fd81261 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-07-09 Joern Rennecke + + * tree-vect-stmts.c (vectorizable_comparison) : + Swap operands only once. + 2019-07-09 Dragan Mladjenovic * cfgcleanup.c (old_insns_match_p): Check if used hard regs set is equal diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index e921225b5ec..601a6f55fbf 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -10369,7 +10369,7 @@ vectorizable_comparison (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, if (!slp_node) { - if (swap_p) + if (swap_p && j == 0) std::swap (vec_rhs1, vec_rhs2); vec_oprnds0.quick_push (vec_rhs1); vec_oprnds1.quick_push (vec_rhs2); -- 2.30.2