We must emit DELTA pseudo-instructions when moving %esp (#5747)
authorSimon Marlow <marlowsd@gmail.com>
Thu, 5 Jan 2012 14:01:58 +0000 (14:01 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 5 Jan 2012 15:20:17 +0000 (15:20 +0000)
compiler/nativeGen/X86/CodeGen.hs

index 2ade04d..5ba1069 100644 (file)
@@ -1744,9 +1744,11 @@ genCCall32 target dest_regs args =
                                                        (ImmInt 0)
                              sz = floatSize w
                          in toOL [ SUB II32 (OpImm (ImmInt b)) (OpReg esp),
+                                   DELTA (delta0 - b),
                                    GST sz fake0 tmp_amode,
                                    MOV sz (OpAddr tmp_amode) (OpReg r_dest),
-                                   ADD II32 (OpImm (ImmInt b)) (OpReg esp)]
+                                   ADD II32 (OpImm (ImmInt b)) (OpReg esp),
+                                   DELTA delta0]
                     else unitOL (GMOV fake0 r_dest)
               | isWord64 ty    = toOL [MOV II32 (OpReg eax) (OpReg r_dest),
                                         MOV II32 (OpReg edx) (OpReg r_dest_hi)]