aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authorJ"orn Rennecke <amylaar@cygnus.co.uk>1999-06-17 09:32:59 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>1999-06-17 10:32:59 +0100
commit41c1b007f1e3a6fd2be2fb67ee219f8652d140c9 (patch)
tree43da2b7ccc8385436279ad0396c9113ea376c01a /gcc/loop.c
parent227d6ce040d7ac43962ab3610f50cbda3dbed544 (diff)
downloadgcc-41c1b007f1e3a6fd2be2fb67ee219f8652d140c9.zip
gcc-41c1b007f1e3a6fd2be2fb67ee219f8652d140c9.tar.gz
gcc-41c1b007f1e3a6fd2be2fb67ee219f8652d140c9.tar.bz2
loop.c (strength_reduce): When doing biv->giv conversion, fix up reg_biv_class.
* loop.c (strength_reduce): When doing biv->giv conversion, fix up reg_biv_class. (recombine_givs): Set ix field after sorting. From-SVN: r27565
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index 90720c4..6f0637f 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -4058,6 +4058,7 @@ strength_reduce (scan_start, end, loop_top, insn_count,
fprintf (loop_dump_stream, "is giv of biv %d\n", bl2->regno);
/* Let this giv be discovered by the generic code. */
REG_IV_TYPE (bl->regno) = UNKNOWN_INDUCT;
+ reg_biv_class[bl->regno] = NULL_PTR;
/* We can get better optimization if we can move the giv setting
before the first giv use. */
if (dominator
@@ -4109,7 +4110,13 @@ strength_reduce (scan_start, end, loop_top, insn_count,
}
/* Remove this biv from the chain. */
if (bl->next)
- *bl = *bl->next;
+ {
+ /* We move the following giv from *bl->next into *bl.
+ We have to update reg_biv_class for that moved biv
+ to point to its new address. */
+ *bl = *bl->next;
+ reg_biv_class[bl->regno] = bl;
+ }
else
{
*backbl = 0;
@@ -7190,16 +7197,18 @@ recombine_givs (bl, loop_start, loop_end, unroll_p)
for (p = v->insn; INSN_UID (p) >= max_uid_for_loop; )
p = PREV_INSN (p);
stats[i].start_luid = INSN_LUID (p);
- v->ix = i;
i++;
}
qsort (stats, giv_count, sizeof(*stats), cmp_recombine_givs_stats);
- /* Do the actual most-recently-used recombination. */
+ /* Set up the ix field for each giv in stats to name
+ the corresponding index into stats, and
+ do the actual most-recently-used recombination. */
for (last_giv = 0, i = giv_count - 1; i >= 0; i--)
{
v = giv_array[stats[i].giv_number];
+ v->ix = i;
if (v->same)
{
struct induction *old_same = v->same;