aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-03-13 20:45:44 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1993-03-13 20:45:44 -0500
commit91a60f374f56e4dad751afb34904d66a4333e695 (patch)
treee78f7589066a6b171424475b9dafe4e3a47be49e /gcc
parentbbc8a07104bc1863ca9550cc27b942c21f009a1e (diff)
downloadgcc-91a60f374f56e4dad751afb34904d66a4333e695.zip
gcc-91a60f374f56e4dad751afb34904d66a4333e695.tar.gz
gcc-91a60f374f56e4dad751afb34904d66a4333e695.tar.bz2
(simplify_plus_minus): When seeing if we have reduced the number of operands...
(simplify_plus_minus): When seeing if we have reduced the number of operands, ensure we count a CONST result as two operands. From-SVN: r3729
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cse.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 6371998..aeb7be5 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -3929,7 +3929,7 @@ simplify_plus_minus (code, mode, op0, op1)
int negs[8];
rtx result, tem;
int n_ops = 2;
- int i, j;
+ int i, j, k;
int first = 1, negate = 0, changed;
bzero (ops, sizeof ops);
@@ -4032,12 +4032,18 @@ simplify_plus_minus (code, mode, op0, op1)
}
/* Pack all the operands to the lower-numbered entries and give up if
- we didn't reduce the number of operands we had. */
- for (i = 0, j = 0; j < n_ops; j++)
+ we didn't reduce the number of operands we had. Make sure we
+ count a CONST as two operands. */
+
+ for (i = 0, j = 0, k = 0; j < n_ops; j++)
if (ops[j] != 0)
- ops[i] = ops[j], negs[i++] = negs[j];
+ {
+ ops[i] = ops[j], negs[i++] = negs[j];
+ if (GET_CODE (ops[j]) == CONST)
+ k++;
+ }
- if (i >= n_ops)
+ if (i + k >= n_ops)
return 0;
n_ops = i;