| Index: src/IceTargetLoweringX8632.cpp
|
| diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
|
| index d4c4c54b3b90d7b849531361b65e0c192b93b11d..313ff41ad7090500fa5e79d43077972afe368060 100644
|
| --- a/src/IceTargetLoweringX8632.cpp
|
| +++ b/src/IceTargetLoweringX8632.cpp
|
| @@ -798,6 +798,8 @@ void TargetX8632::addProlog(CfgNode *Node) {
|
| Variable *esp = getPhysicalRegister(RegX8632::Reg_esp);
|
| _push(ebp);
|
| _mov(ebp, esp);
|
| + // Keep ebp live in asm-verbose mode.
|
| + Context.insert(InstFakeUse::create(Func, ebp));
|
| }
|
|
|
| // Align the variables area. SpillAreaPaddingBytes is the size of
|
| @@ -940,6 +942,10 @@ void TargetX8632::addEpilog(CfgNode *Node) {
|
| Variable *esp = getPhysicalRegister(RegX8632::Reg_esp);
|
| if (IsEbpBasedFrame) {
|
| Variable *ebp = getPhysicalRegister(RegX8632::Reg_ebp);
|
| + // For asm-verbose mode, adding a fake use of esp before the
|
| + // assignment of esp=ebp keeps previous esp adjustments from being
|
| + // dead-code eliminated.
|
| + Context.insert(InstFakeUse::create(Func, esp));
|
| _mov(esp, ebp);
|
| _pop(ebp);
|
| } else {
|
| @@ -4309,6 +4315,9 @@ void TargetX8632::lowerPhiAssignments(CfgNode *Node,
|
| RegNum = RegsForType.find_first();
|
| Preg = getPhysicalRegister(RegNum, Dest->getType());
|
| SpillLoc = Func->makeVariable(Dest->getType());
|
| + // Create a fake def of the physical register to avoid
|
| + // liveness inconsistency problems in asm-verbose mode.
|
| + Context.insert(InstFakeDef::create(Func, Preg));
|
| if (IsVector)
|
| _movp(SpillLoc, Preg);
|
| else
|
| @@ -4335,6 +4344,9 @@ void TargetX8632::lowerPhiAssignments(CfgNode *Node,
|
| _movp(Preg, SpillLoc);
|
| else
|
| _mov(Preg, SpillLoc);
|
| + // Create a fake use of the physical register to keep it live
|
| + // in asm-verbose mode.
|
| + Context.insert(InstFakeUse::create(Func, Preg));
|
| }
|
| }
|
| // Update register availability before moving to the previous
|
|
|