aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2004-09-13 23:25:12 +0000
committerDaniel Jacobowitz <drow@gcc.gnu.org>2004-09-13 23:25:12 +0000
commit3ab0f29005da8dbc7a51fd8a995559e1b40f88e7 (patch)
tree5241e18372b0806679b1ea09b8e21501d956f9b3
parent6674a6ce49dc1cba7ca46cdd9cf4a62ede556568 (diff)
downloadgcc-3ab0f29005da8dbc7a51fd8a995559e1b40f88e7.zip
gcc-3ab0f29005da8dbc7a51fd8a995559e1b40f88e7.tar.gz
gcc-3ab0f29005da8dbc7a51fd8a995559e1b40f88e7.tar.bz2
expmed.c (synth_mult): Initialize latency.
* expmed.c (synth_mult): Initialize latency. Check cost before checking ops count. From-SVN: r87456
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/expmed.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5609638..419c409 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-13 Daniel Jacobowitz <dan@debian.org>
+
+ * expmed.c (synth_mult): Initialize latency. Check cost before
+ checking ops count.
+
2004-09-26 Kenneth Zadeck <Kenneth.Zadeck@NaturalBridge.com>
diff --git a/gcc/expmed.c b/gcc/expmed.c
index eb8226d..232381f 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -2247,6 +2247,7 @@ synth_mult (struct algorithm *alg_out, unsigned HOST_WIDE_INT t,
/* Indicate that no algorithm is yet found. If no algorithm
is found, this value will be returned and indicate failure. */
alg_out->cost.cost = cost_limit->cost + 1;
+ alg_out->cost.latency = cost_limit->latency + 1;
if (cost_limit->cost < 0
|| (cost_limit->cost == 0 && cost_limit->latency <= 0))
@@ -2516,15 +2517,15 @@ synth_mult (struct algorithm *alg_out, unsigned HOST_WIDE_INT t,
}
}
+ /* If best_cost has not decreased, we have not found any algorithm. */
+ if (!CHEAPER_MULT_COST (&best_cost, cost_limit))
+ return;
+
/* If we are getting a too long sequence for `struct algorithm'
to record, make this search fail. */
if (best_alg->ops == MAX_BITS_PER_WORD)
return;
- /* If best_cost has not decreased, we have not found any algorithm. */
- if (!CHEAPER_MULT_COST (&best_cost, cost_limit))
- return;
-
/* Copy the algorithm from temporary space to the space at alg_out.
We avoid using structure assignment because the majority of
best_alg is normally undefined, and this is a critical function. */