Fixed bug in bad behavior in calculateFrameObjectOffsets,
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Tue, 3 Jun 2008 08:46:59 +0000 (08:46 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Tue, 3 Jun 2008 08:46:59 +0000 (08:46 +0000)
the solution commited is different from the previous patch to
avoid int and unsigned comparison

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51899 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PrologEpilogInserter.cpp

index fda08bc29f63911b3b590e631d41ea6740462034..c52da321c1e9a05e922486ff70c1a21f279bc3a7 100644 (file)
@@ -362,7 +362,8 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
       FFI->setObjectOffset(i, -Offset);        // Set the computed offset
     }
   } else {
-    for (unsigned i = MaxCSFrameIndex; i >= MinCSFrameIndex; --i) {
+    int MaxCSFI = MaxCSFrameIndex, MinCSFI = MinCSFrameIndex;
+    for (int i = MaxCSFI; i >= MinCSFI ; --i) {
       unsigned Align = FFI->getObjectAlignment(i);
       // If the alignment of this object is greater than that of the stack, then
       // increase the stack alignment to match.