[runtime] Skip non-SSA variables in Abcrem.
authorVladimir Kargov <kargov@gmail.com>
Sat, 4 Feb 2017 03:38:53 +0000 (19:38 -0800)
committerVladimir Kargov <kargov@gmail.com>
Mon, 6 Feb 2017 23:51:27 +0000 (15:51 -0800)
mono/mini/abcremoval.c

index 773982b4de747a920247a8cd588fec8688c5b38e..7555c36141e700ea37d579120a4909deb1efb418 100644 (file)
@@ -1299,10 +1299,22 @@ mono_perform_abc_removal (MonoCompile *cfg)
 
                for (ins = bb->code; ins; ins = ins->next) {
                        const char *spec = INS_INFO (ins->opcode);
+                       gint32 idx, *reg;
                        
                        if (spec [MONO_INST_DEST] == ' ' || MONO_IS_STORE_MEMBASE (ins))
                                continue;
 
+                       MONO_INS_FOR_EACH_REG (ins, idx, reg) {
+                               MonoInst *var = get_vreg_to_inst (cfg, *reg);
+                               if (var && (!MONO_VARINFO (cfg, var->inst_c0)->def))
+                                               break;
+                       }
+                       if (idx < MONO_INST_LEN) {
+                               if (TRACE_ABC_REMOVAL)
+                                       printf ("Global register %d is not in the SSA form, skipping.\n", *reg);
+                               continue;
+                       }
+
                        if (spec [MONO_INST_DEST] == 'i') {
                                MonoIntegerValueKind effective_value_kind;
                                MonoRelationsEvaluationRange range;