+2005-12-02 Alan Modra <amodra@bigpond.net.au>
+
+ * simplify-rtx.c (simplify_plus_minus): Do simplify constants.
+ Delete dead code.
+
2005-12-01 Richard Henderson <rth@redhat.com>
* optabs.c (expand_vec_cond_expr): Use EXPAND_NORMAL.
{
struct simplify_plus_minus_op_data ops[8];
rtx result, tem;
- int n_ops = 2, input_ops = 2, input_consts = 0, n_consts;
+ int n_ops = 2, input_ops = 2;
int first, changed, canonicalized = 0;
int i, j;
ops[n_ops].op = XEXP (XEXP (this_op, 0), 1);
ops[n_ops].neg = this_neg;
n_ops++;
- input_consts++;
changed = 1;
canonicalized = 1;
}
gcc_assert (n_ops >= 2);
if (!canonicalized)
- return NULL_RTX;
+ {
+ int n_constants = 0;
+
+ for (i = 0; i < n_ops; i++)
+ if (GET_CODE (ops[i].op) == CONST_INT)
+ n_constants++;
+
+ if (n_constants <= 1)
+ return NULL_RTX;
+ }
/* If we only have two operands, we can avoid the loops. */
if (n_ops == 2)
return simplify_const_binary_operation (code, mode, lhs, rhs);
}
- /* Count the number of CONSTs we didn't split above. */
- for (i = 0; i < n_ops; i++)
- if (GET_CODE (ops[i].op) == CONST)
- input_consts++;
-
/* Now simplify each pair of operands until nothing changes. The first
time through just simplify constants against each other. */
n_ops--;
}
- /* Count the number of CONSTs that we generated. */
- n_consts = 0;
- for (i = 0; i < n_ops; i++)
- if (GET_CODE (ops[i].op) == CONST)
- n_consts++;
-
/* Put a non-negated operand first, if possible. */
for (i = 0; i < n_ops && ops[i].neg; i++)