aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/regclass.c12
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8998871..fe4c381 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
Tue Jan 4 00:18:46 2000 Jeffrey A Law (law@cygnus.com)
+ * regclass.c (regclass): Properly compute loop_cost. Adjust
+ comments.
+
* regclass.c: Fix minor whitespace problems.
2000-01-03 Anthony Green <green@cygnus.com>
diff --git a/gcc/regclass.c b/gcc/regclass.c
index d25af73..667250c 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -1100,13 +1100,17 @@ regclass (f, nregs, dump)
basic_block bb = BASIC_BLOCK (index);
/* Show that an insn inside a loop is likely to be executed three
- times more than insns outside a loop. This is much more aggressive
- than the assumptions made elsewhere and is being tried as an
- experiment. */
+ times more than insns outside a loop. This is much more
+ aggressive than the assumptions made elsewhere and is being
+ tried as an experiment.
+
+ Note that a block's loop depth starts at zero, not one! We
+ must not subract one from the loop depth as that could give
+ a negative shift count below. */
if (optimize_size)
loop_cost = 1;
else
- loop_cost = 1 << (2 * MIN (bb->loop_depth - 1, 5));
+ loop_cost = 1 << (2 * MIN (bb->loop_depth, 5));
for (insn = bb->head; ; insn = NEXT_INSN (insn))
{
insn = scan_one_insn (insn, pass);