aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/MachineFunction.cpp2
-rw-r--r--lib/CodeGen/PrologEpilogInserter.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp
index 221d67b82c..4dfd7f7782 100644
--- a/lib/CodeGen/MachineFunction.cpp
+++ b/lib/CodeGen/MachineFunction.cpp
@@ -201,7 +201,7 @@ void MachineFrameInfo::print(const MachineFunction &MF, std::ostream &OS) const{
if (i < NumFixedObjects)
OS << " fixed";
if (i < NumFixedObjects || SO.SPOffset != -1) {
- int Off = SO.SPOffset + ValOffset;
+ int Off = SO.SPOffset - ValOffset;
OS << " at location [SP";
if (Off > 0)
OS << "+" << Off;
diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp
index e9a998b873..6157e3fc99 100644
--- a/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/lib/CodeGen/PrologEpilogInserter.cpp
@@ -206,7 +206,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
// of stack growth -- so it's always positive.
int Offset = TFI.getOffsetOfLocalArea();
if (StackGrowsDown)
- Offset = -Offset;
+ Offset = -Offset;
assert(Offset >= 0
&& "Local area offset should be in direction of stack growth");
@@ -256,7 +256,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
Offset = (Offset+StackAlignment-1)/StackAlignment*StackAlignment;
// Set the final value of the stack pointer...
- FFI->setStackSize(Offset-TFI.getOffsetOfLocalArea());
+ FFI->setStackSize(Offset+TFI.getOffsetOfLocalArea());
}