aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cse.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dfff20c..3784190 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2003-07-17 Roger Sayle <roger@eyesopen.com>
+ * 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 <roger@eyesopen.com>
+
* fold-const.c (const_binop): Avoid performing the FP operation at
compile-time, if either operand is NaN and we honor signaling NaNs,
or if we're dividing by zero and either flag_trapping_math is set
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);