Index: lib/CodeGen/MachineVerifier.cpp =================================================================== --- lib/CodeGen/MachineVerifier.cpp +++ lib/CodeGen/MachineVerifier.cpp @@ -2019,6 +2019,7 @@ int ExitValue; bool EntryIsSetup; bool ExitIsSetup; + std::stack FrameSetupSize; }; } @@ -2050,6 +2051,7 @@ BBState.EntryIsSetup = SPState[StackPred->getNumber()].ExitIsSetup; BBState.ExitValue = BBState.EntryValue; BBState.ExitIsSetup = BBState.EntryIsSetup; + BBState.FrameSetupSize = SPState[StackPred->getNumber()].FrameSetupSize; } // Update stack state by checking contents of MBB. @@ -2060,10 +2062,9 @@ assert(Size >= 0 && "Value should be non-negative in FrameSetup and FrameDestroy.\n"); - if (BBState.ExitIsSetup) - report("FrameSetup is after another FrameSetup", &I); BBState.ExitValue -= Size; BBState.ExitIsSetup = true; + BBState.FrameSetupSize.push(Size); } if (I.getOpcode() == FrameDestroyOpcode) { @@ -2072,15 +2073,17 @@ assert(Size >= 0 && "Value should be non-negative in FrameSetup and FrameDestroy.\n"); - if (!BBState.ExitIsSetup) - report("FrameDestroy is not after a FrameSetup", &I); - int AbsSPAdj = BBState.ExitValue < 0 ? -BBState.ExitValue : - BBState.ExitValue; - if (BBState.ExitIsSetup && AbsSPAdj != Size) { - report("FrameDestroy is after FrameSetup ", &I); - errs() << "FrameDestroy <" << Size << "> is after FrameSetup <" - << AbsSPAdj << ">.\n"; + if (!BBState.FrameSetupSize.empty()) + { + if (BBState.FrameSetupSize.top() != Size) { + report("FrameDestroy is after FrameSetup ", &I); + errs() << "FrameDestroy <" << Size << "> is after FrameSetup <" + << BBState.FrameSetupSize.top() << ">.\n"; + } + BBState.FrameSetupSize.pop(); } + else + report("FrameDestroy is not after a FrameSetup", &I); BBState.ExitValue += Size; BBState.ExitIsSetup = false; } Index: test/CodeGen/Mips/largeimmprinting.ll =================================================================== --- test/CodeGen/Mips/largeimmprinting.ll +++ test/CodeGen/Mips/largeimmprinting.ll @@ -1,7 +1,7 @@ -; RUN: llc -march=mipsel -relocation-model=pic < %s | FileCheck %s -check-prefix=32 -; RUN: llc -march=mips64el -mcpu=mips4 -target-abi=n64 -relocation-model=pic < %s | \ +; RUN: llc -march=mipsel -relocation-model=pic -verify-machineinstrs < %s | FileCheck %s -check-prefix=32 +; RUN: llc -march=mips64el -mcpu=mips4 -target-abi=n64 -relocation-model=pic -verify-machineinstrs < %s | \ ; RUN: FileCheck %s -check-prefix=64 -; RUN: llc -march=mips64el -mcpu=mips64 -target-abi=n64 -relocation-model=pic < %s | \ +; RUN: llc -march=mips64el -mcpu=mips64 -target-abi=n64 -relocation-model=pic -verify-machineinstrs < %s | \ ; RUN: FileCheck %s -check-prefix=64 %struct.S1 = type { [65536 x i8] }