diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-08-15 13:10:46 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-08-15 13:10:46 +0000 |
commit | d62c9a697b53f9e754926a89126fd121220ed09b (patch) | |
tree | 1d8487daca8b7c6fc4da44210cb233853a89824e /lib/CodeGen/PrologEpilogInserter.cpp | |
parent | 4af85b2328d432960371efeb092a70a8d9c25227 (diff) | |
download | external_llvm-d62c9a697b53f9e754926a89126fd121220ed09b.zip external_llvm-d62c9a697b53f9e754926a89126fd121220ed09b.tar.gz external_llvm-d62c9a697b53f9e754926a89126fd121220ed09b.tar.bz2 |
Don't setCalleeSavedInfoValid() until spills are interted.
In a naked function, the flag is never set and getPristineRegs() returns an
empty list. That means naked functions are able to clobber callee saved
registers, but that is the whole point of naked functions.
This fixes PR4716.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79096 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PrologEpilogInserter.cpp')
-rw-r--r-- | lib/CodeGen/PrologEpilogInserter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp index 8b05f4c..608e4c5 100644 --- a/lib/CodeGen/PrologEpilogInserter.cpp +++ b/lib/CodeGen/PrologEpilogInserter.cpp @@ -214,8 +214,6 @@ void PEI::calculateCalleeSavedRegisters(MachineFunction &Fn) { } } - FFI->setCalleeSavedInfoValid(true); - if (CSI.empty()) return; // Early exit if no callee saved registers are modified! @@ -274,6 +272,8 @@ void PEI::insertCSRSpillsAndRestores(MachineFunction &Fn) { MachineFrameInfo *FFI = Fn.getFrameInfo(); const std::vector<CalleeSavedInfo> &CSI = FFI->getCalleeSavedInfo(); + FFI->setCalleeSavedInfoValid(true); + // Early exit if no callee saved registers are modified! if (CSI.empty()) return; |