[Patch] Give more chance to 'simplify_plus_minus' in simplify-rtx.c too catch something
Christophe Jaillet
christophe.jaillet@wanadoo.fr
Sat Feb 4 08:35:00 GMT 2006
OOps, the patch seems reversed, here it is again :
2006-02-04 Christophe Jaillet <christophe.jaillet@wanadoo.fr>
* simplify-rtx.c (simplify_plus_minus): Remove hard coded constants.
Use full size of ops array for
catching more opportunities.
Remove a useless gcc_assert()
--- .svn/text-base/simplify-rtx.c.svn-base 2006-01-10 20:51:28.000000000
+0100
+++ simplify-rtx.c 2006-02-04 09:31:54.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;
@@ -3219,7 +3219,6 @@ simplify_plus_minus (enum rtx_code code,
}
while (changed);
- gcc_assert (n_ops >= 2);
if (!canonicalized)
{
int n_constants = 0;
More information about the Gcc-patches
mailing list