compiler: update max_used_temp_reg before use
authorWim Taymans <wtaymans@redhat.com>
Fri, 26 Sep 2014 10:11:14 +0000 (12:11 +0200)
committerWim Taymans <wtaymans@redhat.com>
Fri, 26 Sep 2014 10:12:42 +0000 (12:12 +0200)
It should not be smaller than min_temp_reg or we will fail to search for
a free register.

orc/orccompiler.c

index 12c6c11..46ae8fe 100644 (file)
@@ -1177,6 +1177,9 @@ orc_compiler_get_constant_reg (OrcCompiler *compiler)
       compiler->alloc_regs[compiler->constants[j].alloc_reg] = 1;
     }
   }
+  if (compiler->max_used_temp_reg < compiler->min_temp_reg)
+    compiler->max_used_temp_reg = compiler->min_temp_reg;
+
   for(j=ORC_VEC_REG_BASE;j<=compiler->max_used_temp_reg;j++) {
     compiler->alloc_regs[j] = 1;
   }