summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-07-23 19:00:02 +0000
committerDuncan Sands <baldrick@free.fr>2009-07-23 19:00:02 +0000
commitf4981105ca485a44ae8055e7e74e6ab6e27ecf46 (patch)
tree9558d76201547b7a4035a7ddf9b19112f6b39d14
parent84b5f6efb781201c7ecb6028bc3f8271b558c794 (diff)
downloadbcm5719-llvm-f4981105ca485a44ae8055e7e74e6ab6e27ecf46.tar.gz
bcm5719-llvm-f4981105ca485a44ae8055e7e74e6ab6e27ecf46.zip
Revert r75581: it causes massive breakage in the Ada
testsuite, due to exception handling not working correctly. Maybe because the libgcc unwinder is miscompiled - not sure, and I won't have time to look into it before leaving on holiday. Note that miscompilations of libgcc are not picked up by the nightly testers, because they dynamically link with libgcc, so pick up the system version rather than the version built as part of llvm-gcc. This is a nasty flaw in the nightly testers. (On the other hand the Ada testsuite links with the just built libgcc). llvm-svn: 76895
-rw-r--r--llvm/lib/Target/X86/X86RegisterInfo.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp
index 751b20598b2..bf523dde880 100644
--- a/llvm/lib/Target/X86/X86RegisterInfo.cpp
+++ b/llvm/lib/Target/X86/X86RegisterInfo.cpp
@@ -784,6 +784,29 @@ void X86RegisterInfo::emitCalleeSavedFrameMoves(MachineFunction &MF,
unsigned Reg = I->getReg();
Offset = MaxOffset - Offset + saveAreaOffset;
+ // Don't output a new machine move if we're re-saving the frame
+ // pointer. This happens when the PrologEpilogInserter has inserted an extra
+ // "PUSH" of the frame pointer -- the "emitPrologue" method automatically
+ // generates one when frame pointers are used. If we generate a "machine
+ // move" for this extra "PUSH", the linker will lose track of the fact that
+ // the frame pointer should have the value of the first "PUSH" when it's
+ // trying to unwind.
+ //
+ // FIXME: This looks inelegant. It's possibly correct, but it's covering up
+ // another bug. I.e., one where we generate a prolog like this:
+ //
+ // pushl %ebp
+ // movl %esp, %ebp
+ // pushl %ebp
+ // pushl %esi
+ // ...
+ //
+ // The immediate re-push of EBP is unnecessary. At the least, it's an
+ // optimization bug. EBP can be used as a scratch register in certain
+ // cases, but probably not when we have a frame pointer.
+ if (HasFP && FramePtr == Reg)
+ continue;
+
MachineLocation CSDst(MachineLocation::VirtualFP, Offset);
MachineLocation CSSrc(Reg);
Moves.push_back(MachineMove(LabelId, CSDst, CSSrc));
OpenPOWER on IntegriCloud