diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-21 01:33:53 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-21 01:33:53 +0000 |
commit | 3c250d8ff076da6005a670805c2af614a9389377 (patch) | |
tree | 4d13aeef83e6b57915789bd1461881e8a64fa871 /gcc/optabs.c | |
parent | cde9d0c7dc4114f5de6e16e3c547a60c8cd2f41d (diff) | |
download | gcc-3c250d8ff076da6005a670805c2af614a9389377.tar.gz |
* optabs.c (emit_cmp_and_jump_insns): Don't swap commutative
operands unless the operation is commutative.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42366 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index a2a42c636b1..1bc8aaf1f0e 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 { |