Typo fix so that liveness is now calculated correctly again; remember to reset
authorDavid Given <dg@cowlark.com>
Fri, 13 Jan 2017 22:08:25 +0000 (23:08 +0100)
committerDavid Given <dg@cowlark.com>
Fri, 13 Jan 2017 22:08:25 +0000 (23:08 +0100)
the storage set on exit so we don't end up with bogus pointers after the heap
is freed.

mach/proto/mcg/pass_livevalueanalysis.c

index 4e83880..2b20cc1 100644 (file)
@@ -53,7 +53,7 @@ static void propagate_liveness(struct basicblock* bb)
                 struct valueusage* usage = hit.value;
 
                 if (usage->input)
-                    set_remove(&known_live, value);
+                    set_add(&known_live, value);
             }
         }
        }
@@ -65,6 +65,7 @@ void pass_live_value_analysis(void)
 
     for (i=0; i<dominance.postorder.count; i++)
         propagate_liveness(dominance.postorder.item[i]);
+    set_reset(&known_live);
 }
 
 /* vim: set sw=4 ts=4 expandtab : */