aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2001-05-22 09:40:26 +0200
committerRichard Henderson <rth@gcc.gnu.org>2001-05-22 00:40:26 -0700
commit8c9864f32d6c76ae5f3317148b29629c60a2f26b (patch)
treee077f1ff6c35cde9817f0a709edaf59ec48986c9 /gcc/combine.c
parent083e9f9217548607ffd2655a2a89341b78fe06c2 (diff)
downloadgcc-8c9864f32d6c76ae5f3317148b29629c60a2f26b.zip
gcc-8c9864f32d6c76ae5f3317148b29629c60a2f26b.tar.gz
gcc-8c9864f32d6c76ae5f3317148b29629c60a2f26b.tar.bz2
combine.c (gen_binary): Use swap_commutative_operands_p
* 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. From-SVN: r42433
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 675b1fe..e36cdef 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -9793,8 +9793,7 @@ gen_binary (code, mode, op0, op1)
rtx tem;
if (GET_RTX_CLASS (code) == 'c'
- && (GET_CODE (op0) == CONST_INT
- || (CONSTANT_P (op0) && GET_CODE (op1) != CONST_INT)))
+ && swap_commutative_operands_p (op0, op1))
tem = op0, op0 = op1, op1 = tem;
if (GET_RTX_CLASS (code) == '<')
@@ -9999,7 +9998,7 @@ simplify_comparison (code, pop0, pop1)
/* If the first operand is a constant, swap the operands and adjust the
comparison code appropriately, but don't do this if the second operand
is already a constant integer. */
- if (CONSTANT_P (op0) && GET_CODE (op1) != CONST_INT)
+ if (swap_commutative_operands_p (op0, op1))
{
tem = op0, op0 = op1, op1 = tem;
code = swap_condition (code);