This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Give more chance to 'simplify_plus_minus' in simplify-rtx.c too catch something


OK, I do 100% agree with you.
I just though that this one was *SO* trivial, that it was useless...

Here is the updated patch without this rafinement.

CJ

_________________________________________

* simplify-rtx.c (simplify_plus_minus): Remove hard coded constants.
                                        Use full size of ops array for
catching more opportunities.


--- .svn/text-base/simplify-rtx.c.svn-base 2006-01-10 20:51:28.000000000
+0100
+++ simplify-rtx.c 2006-02-04 16:10:32.000000000 +0100
@@ -3154,7 +3154,7 @@ simplify_plus_minus (enum rtx_code code,
      {
      case PLUS:
      case MINUS:
-       if (n_ops == 7)
+       if (n_ops == ARRAY_SIZE (ops))
   return NULL_RTX;

        ops[n_ops].op = XEXP (this_op, 1);
@@ -3175,7 +3175,7 @@ simplify_plus_minus (enum rtx_code code,
        break;

      case CONST:
-       if (n_ops < 7
+       if (n_ops != ARRAY_SIZE (ops)
     && GET_CODE (XEXP (this_op, 0)) == PLUS
     && CONSTANT_P (XEXP (XEXP (this_op, 0), 0))
     && CONSTANT_P (XEXP (XEXP (this_op, 0), 1)))
@@ -3191,7 +3191,7 @@ simplify_plus_minus (enum rtx_code code,

      case NOT:
        /* ~a -> (-a - 1) */
-       if (n_ops != 7)
+       if (n_ops != ARRAY_SIZE(ops))
   {
     ops[n_ops].op = constm1_rtx;
     ops[n_ops++].neg = this_neg;




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]