Skip to content

Commit

Permalink
2010-03-09 Zoltan Varga <vargaz@gmail.com>
Browse files Browse the repository at this point in the history
	* mini-codegen.c (mono_peephole_ins): Fix the OP_FMOVE optimization. Fixes
	#586664.

	* iltests.il.in: Add a test.

svn path=/branches/mono-2-6/mono/; revision=153333
  • Loading branch information
vargaz committed Mar 9, 2010
1 parent 1a83199 commit 05df794
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
7 changes: 7 additions & 0 deletions mono/mini/ChangeLog
@@ -1,3 +1,10 @@
2010-03-09 Zoltan Varga <vargaz@gmail.com>

* mini-codegen.c (mono_peephole_ins): Fix the OP_FMOVE optimization. Fixes
#586664.

* iltests.il.in: Add a test.

2010-03-08 Rodrigo Kumpera <rkumpera@novell.com>

* method-to-ir.c: Store the initial basic block returned by mono_basic_block_split
Expand Down
42 changes: 42 additions & 0 deletions mono/mini/iltests.il.in
Expand Up @@ -2406,4 +2406,46 @@ OK_2:
ldc.i4.0
ret
}

.method public static hidebysig
default int32 test_0_regress_586664 () cil managed
{
// Method begins at RVA 0x20f4
// Code size 76 (0x4c)
.maxstack 6
.locals init (
float64 V_0,
float64[] V_1)
IL_0000: ldc.r8 1.
IL_0009: ldc.r8 2.
IL_0012: ldc.r8 1.
IL_001b: call float64 class [mscorlib]System.Math::Pow(float64, float64)
IL_0020: div
IL_0021: stloc.0
IL_0022: ldc.i4.2
IL_0023: newarr [mscorlib]System.Double
IL_0028: dup
IL_0029: ldc.i4.0
IL_002a: ldloc.0
IL_002b: neg
IL_002c: stelem.r8
IL_002d: dup
IL_002e: ldc.i4.1
IL_002f: ldloc.0
IL_0030: neg
IL_0031: stelem.r8
IL_0032: stloc.1
IL_0033: ldloc.1
IL_0034: ldc.i4.0
IL_0035: ldelem.r8
IL_0036: ldc.r8 -0.5
IL_003f: bne.un IL_004a

IL_0044: ldc.i4.0
IL_0045: br IL_004b

IL_004a: ldc.i4.1
IL_004b: ret
}

}
2 changes: 1 addition & 1 deletion mono/mini/mini-codegen.c
Expand Up @@ -2540,7 +2540,7 @@ mono_peephole_ins (MonoBasicBlock *bb, MonoInst *ins)
* OP_MOVE sreg, dreg
* OP_MOVE dreg, sreg
*/
if (last_ins && last_ins->opcode == OP_MOVE &&
if (last_ins && last_ins->opcode == ins->opcode &&
ins->sreg1 == last_ins->dreg &&
ins->dreg == last_ins->sreg1) {
MONO_DELETE_INS (bb, ins);
Expand Down

0 comments on commit 05df794

Please sign in to comment.