bug fix
authorbdemsky <bdemsky>
Wed, 24 Jun 2009 09:44:31 +0000 (09:44 +0000)
committerbdemsky <bdemsky>
Wed, 24 Jun 2009 09:44:31 +0000 (09:44 +0000)
Robust/src/Analysis/Loops/CopyPropagation.java

index 9d211cf96b212778b63eb8d350363ae1378176da..3fd27ef71a0f7fae7ac793bc3415eebe228935b1 100644 (file)
@@ -33,15 +33,18 @@ public class CopyPropagation {
        HashSet<TempDescriptor> toremove=new HashSet<TempDescriptor>();
        for(int i=1;i<fn.numPrev();i++) {
          Hashtable<TempDescriptor, TempDescriptor> tp=table.get(fn.getPrev(i));
-         for(Iterator tmpit=tab.entrySet().iterator();tmpit.hasNext();) {
+         for(Iterator tmpit=tp.entrySet().iterator();tmpit.hasNext();) {
            Map.Entry t=(Map.Entry)tmpit.next();
            TempDescriptor tmp=(TempDescriptor)t.getKey();
-           if (tp!=null&&tp.containsKey(tmp)&&tp.get(tmp)!=tab.get(tmp)) {
-             toremove.add(tmp);
+           
+           if (!tab.containsKey(tmp))
+             tab.put(tmp, tp.get(tmp));
+           else if (tab.get(tmp)!=tp.get(tmp)) {
+             tab.put(tmp, bogustd);
            }
          }
        }
-
+       
        TempDescriptor[]writes=fn.writesTemps();
        for(int i=0;i<writes.length;i++) {
          TempDescriptor tmp=writes[i];