]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
naive_phi now recognizes both store_local and store_value as non-global, create_store...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 3 May 2012 12:01:56 +0000 (14:01 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 3 May 2012 12:01:56 +0000 (14:01 +0200)
ir.c

diff --git a/ir.c b/ir.c
index a390ad795bde42d965d8dd693b79bc366a98e8fc..56d961ab361da9b060a61f8b8b3bfcf73647ceae 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -620,6 +620,7 @@ bool ir_block_create_store_op(ir_block *self, int op, ir_value *target, ir_value
 {
     if (target->store == store_value) {
         fprintf(stderr, "cannot store to an SSA value\n");
+        fprintf(stderr, "trying to store: %s <- %s\n", target->name, what->name);
         return false;
     } else {
         ir_instr *in = ir_instr_new(self, op);
@@ -1277,7 +1278,7 @@ static bool ir_block_naive_phi(ir_block *self)
                 if (v->writes[w]->_ops[0] == v)
                     v->writes[w]->_ops[0] = instr->_ops[0];
 
-                if (old->store != store_local)
+                if (old->store != store_value && old->store != store_local)
                 {
                     /* If it originally wrote to a global we need to store the value
                      * there as welli