Make sure stack manipulation refers to ESP the right number of times
authorChris Lattner <sabre@nondot.org>
Mon, 16 Dec 2002 22:29:06 +0000 (22:29 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 16 Dec 2002 22:29:06 +0000 (22:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5086 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/InstSelectSimple.cpp
lib/Target/X86/X86ISelSimple.cpp

index dd93142f64feea46f09583818040f0464eee4517..e35867df009df3ffabdbc1104bfe5e6d438cd0a7 100644 (file)
@@ -1092,7 +1092,8 @@ ISel::visitAllocaInst (AllocaInst &I)
   unsigned int allocatedTypeWords = allocatedTypeSize / 4;
   if (allocatedTypeSize % 4 != 0) { allocatedTypeWords++; }
   // Subtract size from stack pointer, thereby allocating some space.
-  BuildMI (BB, X86::SUBri32, 1, X86::ESP).addZImm (allocatedTypeWords * 4);
+  BuildMI(BB, X86::SUBri32, 2,
+          X86::ESP).addReg(X86::ESP).addZImm(allocatedTypeWords * 4);
   // Put a pointer to the space into the result register, by copying
   // the stack pointer.
   BuildMI (BB, X86::MOVrr32, 1, getReg (I)).addReg (X86::ESP);
index dd93142f64feea46f09583818040f0464eee4517..e35867df009df3ffabdbc1104bfe5e6d438cd0a7 100644 (file)
@@ -1092,7 +1092,8 @@ ISel::visitAllocaInst (AllocaInst &I)
   unsigned int allocatedTypeWords = allocatedTypeSize / 4;
   if (allocatedTypeSize % 4 != 0) { allocatedTypeWords++; }
   // Subtract size from stack pointer, thereby allocating some space.
-  BuildMI (BB, X86::SUBri32, 1, X86::ESP).addZImm (allocatedTypeWords * 4);
+  BuildMI(BB, X86::SUBri32, 2,
+          X86::ESP).addReg(X86::ESP).addZImm(allocatedTypeWords * 4);
   // Put a pointer to the space into the result register, by copying
   // the stack pointer.
   BuildMI (BB, X86::MOVrr32, 1, getReg (I)).addReg (X86::ESP);