]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
loop.c (strength_reduce): When doing biv->giv conversion, fix up reg_biv_class.
authorJ"orn Rennecke <amylaar@cygnus.co.uk>
Mon, 2 Aug 1999 22:50:49 +0000 (22:50 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Mon, 2 Aug 1999 22:50:49 +0000 (23:50 +0100)
* loop.c (strength_reduce): When doing biv->giv conversion, fix up
reg_biv_class.

From-SVN: r28413

gcc/ChangeLog
gcc/loop.c

index ec354394aa8cbed13fa912f584a2741ca37f8520..d84431970099cc21efed7f969d903e21754735eb 100644 (file)
@@ -1,3 +1,8 @@
+Mon Aug  2 23:46:45 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+       * loop.c (strength_reduce): When doing biv->giv conversion, fix up
+       reg_biv_class.
+
 1999-08-02  Jakub Jelinek  <jj@ultra.linux.cz>
 
        * config/float-sparc.h: New file.
index db50a1862e56a824b7ef3a76ce7d23c58933a307..0b02cc2a41c5cda279a606220da67d232932f029 100644 (file)
@@ -4072,6 +4072,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
@@ -4123,7 +4124,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;