This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] Give more chance to 'simplify_plus_minus' in simplify-rtx.c too catch something
- From: "Christophe Jaillet" <christophe dot jaillet at wanadoo dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 4 Feb 2006 16:14:05 +0100
- Subject: Re: [Patch] Give more chance to 'simplify_plus_minus' in simplify-rtx.c too catch something
- References: <ds1olu$duf$1@sea.gmane.org> <02e401c62985$471203f0$bf03030a@trilan>
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;