In bflow(), it was possible to inadvertently delete an instruction that
authorDonn Seeley <donn@ucbvax.Berkeley.EDU>
Sat, 16 Jan 1988 11:24:28 +0000 (03:24 -0800)
committerDonn Seeley <donn@ucbvax.Berkeley.EDU>
Sat, 16 Jan 1988 11:24:28 +0000 (03:24 -0800)
writes into a temporary register because it was examined a second time for
writes to a dead register after a preceding instruction was deleted.  I fixed
this by forcing a return after the first deletion.  There are probably more
bugs like this lurking in bflow()...

SCCS-vsn: old/pcc/c2.tahoe/c21.c 1.6

usr/src/old/pcc/c2.tahoe/c21.c

index 776178d..5988699 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)c21.c      1.5 (Berkeley/CCI) %G%";
+static char sccsid[] = "@(#)c21.c      1.6 (Berkeley/CCI) %G%";
 #endif
 
 /*
 #endif
 
 /*
@@ -650,7 +650,8 @@ bflow(p)
                                if (tempreg(src,r2))
                                        uses[r2]=uses[r], uses[r]=0;
                                redun3(p);
                                if (tempreg(src,r2))
                                        uses[r2]=uses[r], uses[r]=0;
                                redun3(p);
-                               newcode(p); redunm++; flow=r;
+                               newcode(p); redunm++;
+                               return(p);      /* avoid stale uses[] data */
                        } else
                                splitrand(p);
                }
                        } else
                                splitrand(p);
                }