summaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-05-22 07:40:26 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-05-22 07:40:26 +0000
commitf5ef1390e4526ed8d83edc8d528e78a80a3667e7 (patch)
treee077f1ff6c35cde9817f0a709edaf59ec48986c9 /gcc/optabs.c
parent17822ef8b47e893b11a7e32bc82a23339501412c (diff)
downloadgcc-f5ef1390e4526ed8d83edc8d528e78a80a3667e7.tar.gz
* combine.c (gen_binary): Use swap_commutative_operands_p
(simplify_comparison): Likewise. * expmed.c (emit_store_flag): Likewise. * expr.c (compare_from_rtx): Likewise. (do_compare_rtx_and_jump): Likewise. * optabs.c (emit_cmp_and_jump_insn): Revert last patch; abort if not emitting a branch and operands want swapping. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42433 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 1bc8aaf1f0e..581fb9b95b2 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -3287,23 +3287,18 @@ emit_cmp_and_jump_insns (x, y, comparison, size, mode, unsignedp, align, label)
unsigned int align;
rtx label;
{
- rtx op0;
- rtx op1;
-
- /* 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;
- }
- else
+ rtx op0 = x, op1 = y;
+
+ /* Swap operands and condition to ensure canonical RTL. */
+ if (swap_commutative_operands_p (x, y))
{
- op0 = x;
- op1 = y;
+ /* If we're not emitting a branch, this means some caller
+ is out of sync. */
+ if (! label)
+ abort ();
+
+ op0 = y, op1 = x;
+ comparison = swap_condition (comparison);
}
#ifdef HAVE_cc0