aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-05-20 18:33:53 -0700
committerRichard Henderson <rth@gcc.gnu.org>2001-05-20 18:33:53 -0700
commit9f4ccc25e3bb42d2109bce3b8bd920c2072c945e (patch)
tree4d13aeef83e6b57915789bd1461881e8a64fa871
parent88e3805d76d44556e6c07062d62a31e7953b5a6a (diff)
downloadgcc-9f4ccc25e3bb42d2109bce3b8bd920c2072c945e.zip
gcc-9f4ccc25e3bb42d2109bce3b8bd920c2072c945e.tar.gz
gcc-9f4ccc25e3bb42d2109bce3b8bd920c2072c945e.tar.bz2
optabs.c (emit_cmp_and_jump_insns): Don't swap commutative operands unless the operation is commutative.
* optabs.c (emit_cmp_and_jump_insns): Don't swap commutative operands unless the operation is commutative. From-SVN: r42366
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/optabs.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 582f100..dc32386 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2001-05-20 Richard Henderson <rth@redhat.com>
+
+ * optabs.c (emit_cmp_and_jump_insns): Don't swap commutative
+ operands unless the operation is commutative.
+
2001-05-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* fold-const.c (tree_expr_nonnegative_p): Detect more non-negative
diff --git a/gcc/optabs.c b/gcc/optabs.c
index a2a42c6..1bc8aaf 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -3289,13 +3289,16 @@ emit_cmp_and_jump_insns (x, y, comparison, size, mode, unsignedp, align, label)
{
rtx op0;
rtx op1;
-
- if (swap_commutative_operands_p (x, y))
+
+ /* We may not swap in the general case, since this is called from
+ compare_from_rtx, and we have no way of reporting the changed
+ comparison code. */
+ if (comparison == swap_condition (comparison)
+ && swap_commutative_operands_p (x, y))
{
/* Swap operands and condition to ensure canonical RTL. */
op0 = y;
op1 = x;
- comparison = swap_condition (comparison);
}
else
{