simplify-rtx.c (simplify_rtx): Use simplify_gen_binary to swap commutative operands...
authorRoger Sayle <roger@eyesopen.com>
Fri, 18 Jul 2003 03:16:32 +0000 (03:16 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Fri, 18 Jul 2003 03:16:32 +0000 (03:16 +0000)
* simplify-rtx.c (simplify_rtx): Use simplify_gen_binary to swap
commutative operands instead of modifying the RTL in-place.

From-SVN: r69539

gcc/ChangeLog
gcc/simplify-rtx.c

index 0fe5852478ad9b77e83731c6626b3f4370d99133..514dfc56375f974488af616658986a1391a2754e 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-17  Roger Sayle  <roger@eyesopen.com>
+
+       * simplify-rtx.c (simplify_rtx): Use simplify_gen_binary to swap
+       commutative operands instead of modifying the RTL in-place.
+
 2003-07-17  Mark Mitchell  <mark@codesourcery.com>
 
        PR optimization/11557
index 8568529ef87b2dad775a3c36576a00efb68d67dd..d4b51627ca30347b0023a6e86c3427def870154f 100644 (file)
@@ -3052,15 +3052,9 @@ simplify_rtx (rtx x)
                                       XEXP (x, 0), GET_MODE (XEXP (x, 0)));
     case 'c':
       if (swap_commutative_operands_p (XEXP (x, 0), XEXP (x, 1)))
-       {
-         rtx tem;
+       return simplify_gen_binary (code, mode, XEXP (x, 1), XEXP (x, 0));
 
-         tem = XEXP (x, 0);
-         XEXP (x, 0) = XEXP (x, 1);
-         XEXP (x, 1) = tem;
-         return simplify_binary_operation (code, mode,
-                                           XEXP (x, 0), XEXP (x, 1));
-       }
+      /* ... fall through ... */
 
     case '2':
       return simplify_binary_operation (code, mode, XEXP (x, 0), XEXP (x, 1));