aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-07-18 00:28:14 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-07-18 00:28:14 +0000
commitc715abddc7937701bde7e38f43338303b79d0e38 (patch)
treee3a66c07d2f13df7bd1630e4d798fae57f6df5d9 /gcc/cse.c
parent3e4093b64f2e2623bba32e733e7e8f08efc700ac (diff)
downloadgcc-c715abddc7937701bde7e38f43338303b79d0e38.zip
gcc-c715abddc7937701bde7e38f43338303b79d0e38.tar.gz
gcc-c715abddc7937701bde7e38f43338303b79d0e38.tar.bz2
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
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 5e6c9e4..7d05102 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);