slight change to ir_value_dump_life; fixing ir_value_life_merge_into: TODO test this...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 23 Aug 2012 20:07:32 +0000 (22:07 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 23 Aug 2012 20:07:32 +0000 (22:07 +0200)
ir.c
ir.h

diff --git a/ir.c b/ir.c
index cb97b29b2a6709a100b9ea94fd2384537d4f701d..d2e1e0f9d612889958fc84385929caec3a63bda6 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -919,7 +919,7 @@ bool ir_value_life_merge_into(ir_value *self, const ir_value *other)
             }
 
             if (life->start <  entry->start &&
-                life->end   >= entry->start)
+                life->end+1 >= entry->start)
             {
                 /* starts earlier and overlaps */
                 entry->start = life->start;
@@ -3109,10 +3109,10 @@ void ir_value_dump(ir_value* v, int (*oprintf)(const char*, ...))
     }
 }
 
-void ir_value_dump_life(ir_value *self, int (*oprintf)(const char*,...))
+void ir_value_dump_life(const ir_value *self, int (*oprintf)(const char*,...))
 {
     size_t i;
-    oprintf("Life of %s:\n", self->name);
+    oprintf("Life of %12s:", self->name);
     for (i = 0; i < self->life_count; ++i)
     {
         oprintf(" + [%i, %i]\n", self->life[i].start, self->life[i].end);
diff --git a/ir.h b/ir.h
index dd48a8accef6e25928d642401220965f9bfcf83a..e044d75163fb318c4f933ecefdeb7b4918b48abf 100644 (file)
--- a/ir.h
+++ b/ir.h
@@ -111,7 +111,7 @@ bool ir_value_lives(ir_value*, size_t);
 bool ir_values_overlap(const ir_value*, const ir_value*);
 
 void ir_value_dump(ir_value*, int (*oprintf)(const char*,...));
-void ir_value_dump_life(ir_value *self, int (*oprintf)(const char*,...));
+void ir_value_dump_life(const ir_value *self, int (*oprintf)(const char*,...));
 
 /* A vector of IR values */
 typedef struct {