From: Roger Sayle Date: Fri, 18 Jul 2003 00:28:14 +0000 (+0000) Subject: cse.c (fold_rtx): Use swap_commutative_operands_p to determine whether to reorder... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c715abddc7937701bde7e38f43338303b79d0e38;p=gcc.git cse.c (fold_rtx): Use swap_commutative_operands_p to determine whether to reorder the operands of... * cse.c (fold_rtx): Use swap_commutative_operands_p to determine whether to reorder the operands of a commutative binary operator. From-SVN: r69534 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dfff20cdaa4..3784190c923 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-07-17 Roger Sayle + + * cse.c (fold_rtx): Use swap_commutative_operands_p to determine + whether to reorder the operands of a commutative binary operator. + 2003-07-17 Roger Sayle * fold-const.c (const_binop): Avoid performing the FP operation at diff --git a/gcc/cse.c b/gcc/cse.c index 5e6c9e40b17..7d051021936 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -3783,10 +3783,11 @@ fold_rtx (rtx x, rtx insn) || code == LTGT || code == UNEQ || code == ORDERED || code == UNORDERED) { - if (must_swap || (const_arg0 - && (const_arg1 == 0 - || (GET_CODE (const_arg0) == CONST_INT - && GET_CODE (const_arg1) != CONST_INT)))) + if (must_swap + || swap_commutative_operands_p (const_arg0 ? const_arg0 + : XEXP (x, 0), + const_arg1 ? const_arg1 + : XEXP (x, 1))) { rtx tem = XEXP (x, 0);