[jit] Fix the peephole optimization added by 9fc7c1de3a2f7d42c732b20e272d9d6693720012...
authorZoltan Varga <vargaz@gmail.com>
Thu, 11 Feb 2016 01:09:07 +0000 (20:09 -0500)
committerZoltan Varga <vargaz@gmail.com>
Thu, 11 Feb 2016 01:09:18 +0000 (20:09 -0500)
mono/mini/cfold.c

index 258e930d20164548e7657beb5c17a865f6223259..a4910feb18003f48f13f6d6a994522daf1039c27 100644 (file)
@@ -336,13 +336,16 @@ mono_constant_fold_ins (MonoCompile *cfg, MonoInst *ins, MonoInst *arg1, MonoIns
                                }
                                break;
                        case OP_COND_EXC_EQ:
-                               if (overwrite) {
-                                       NULLIFY_INS (ins);
-                                       NULLIFY_INS (next);
-                               } else {
-                                       ALLOC_DEST (cfg, dest, ins);
-                                       dest->opcode = OP_ICONST;
-                                       dest->inst_c0 = res;
+                               res = arg1->inst_c0 == arg2->inst_c0;
+                               if (!res) {
+                                       if (overwrite) {
+                                               NULLIFY_INS (ins);
+                                               NULLIFY_INS (next);
+                                       } else {
+                                               ALLOC_DEST (cfg, dest, ins);
+                                               dest->opcode = OP_ICONST;
+                                               dest->inst_c0 = res;
+                                       }
                                }
                                break;
                        case OP_NOP: