aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>2013-07-26 08:22:25 +0000
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>2013-07-26 08:22:25 +0000
commit85bd4ac6e2dd81712e54d7f6e8c17340dcb36a11 (patch)
treeffddeade2b2ae6b5997db6302eb68fa641da9d57 /gcc/combine.c
parent62038e61fea9911e708cdc9f9f3fa16557cf9ad0 (diff)
downloadgcc-85bd4ac6e2dd81712e54d7f6e8c17340dcb36a11.zip
gcc-85bd4ac6e2dd81712e54d7f6e8c17340dcb36a11.tar.gz
gcc-85bd4ac6e2dd81712e54d7f6e8c17340dcb36a11.tar.bz2
combine.c (simplify_comparison): Re-canonicalize operands where appropriate.
2013-07-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com> Richard Earnshaw <richard.earnshaw@arm.com> * combine.c (simplify_comparison): Re-canonicalize operands where appropriate. * config/arm/arm.md (movcond_addsi): New splitter. Co-Authored-By: Richard Earnshaw <rearnsha@arm.com> From-SVN: r201260
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index fc94c68..754cd34 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -11990,6 +11990,13 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
}
}
+ /* We may have changed the comparison operands. Re-canonicalize. */
+ if (swap_commutative_operands_p (op0, op1))
+ {
+ tem = op0, op0 = op1, op1 = tem;
+ code = swap_condition (code);
+ }
+
/* If this machine only supports a subset of valid comparisons, see if we
can convert an unsupported one into a supported one. */
target_canonicalize_comparison (&code, &op0, &op1, 0);