Commit b7d9299b by Richard Kenner

(simplify_plus_minus): Remove last change.

(simplify_plus_minus): Remove last change.  Instead, count initial
operands and test against that count to see if we did anything.

From-SVN: r3748
parent 682a59fa
...@@ -3928,7 +3928,7 @@ simplify_plus_minus (code, mode, op0, op1) ...@@ -3928,7 +3928,7 @@ simplify_plus_minus (code, mode, op0, op1)
rtx ops[8]; rtx ops[8];
int negs[8]; int negs[8];
rtx result, tem; rtx result, tem;
int n_ops = 2; int n_ops = 2, input_ops = 2;
int i, j, k; int i, j, k;
int first = 1, negate = 0, changed; int first = 1, negate = 0, changed;
...@@ -3956,6 +3956,7 @@ simplify_plus_minus (code, mode, op0, op1) ...@@ -3956,6 +3956,7 @@ simplify_plus_minus (code, mode, op0, op1)
ops[n_ops] = XEXP (ops[i], 1); ops[n_ops] = XEXP (ops[i], 1);
negs[n_ops++] = GET_CODE (ops[i]) == MINUS ? !negs[i] : negs[i]; negs[n_ops++] = GET_CODE (ops[i]) == MINUS ? !negs[i] : negs[i];
ops[i] = XEXP (ops[i], 0); ops[i] = XEXP (ops[i], 0);
input_ops++;
changed = 1; changed = 1;
break; break;
...@@ -4015,17 +4016,7 @@ simplify_plus_minus (code, mode, op0, op1) ...@@ -4015,17 +4016,7 @@ simplify_plus_minus (code, mode, op0, op1)
ncode = MINUS; ncode = MINUS;
tem = simplify_binary_operation (ncode, mode, lhs, rhs); tem = simplify_binary_operation (ncode, mode, lhs, rhs);
if (tem)
/* If we got a simple object, a SUBREG of a simple
object, or a NEG, use it. Otherwise, we either got nothing
or we got something (like a NOT), which can cause an
infinite loop. */
if (tem != 0
&& ((GET_CODE (tem) == SUBREG
&& GET_RTX_CLASS (GET_CODE (SUBREG_REG (tem))) == 'o')
|| GET_CODE (tem) == NEG
|| GET_RTX_CLASS (GET_CODE (tem)) == 'o'))
{ {
ops[i] = tem, ops[j] = 0; ops[i] = tem, ops[j] = 0;
negs[i] = negs[i] && negs[j]; negs[i] = negs[i] && negs[j];
...@@ -4053,7 +4044,7 @@ simplify_plus_minus (code, mode, op0, op1) ...@@ -4053,7 +4044,7 @@ simplify_plus_minus (code, mode, op0, op1)
k++; k++;
} }
if (i + k >= n_ops) if (i + k >= input_ops)
return 0; return 0;
n_ops = i; n_ops = i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment