Zap some completely ridiculous code. There's probably a miscompile here, but I don...
authorEli Friedman <eli.friedman@gmail.com>
Tue, 29 Nov 2011 01:18:23 +0000 (01:18 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Tue, 29 Nov 2011 01:18:23 +0000 (01:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145347 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineCalls.cpp

index e8136ab77ff14f3c49e4ffae1e573b03297f8483..81dad7e022e1eb83fbcc4cce5f749d845eb26f86 100644 (file)
@@ -960,7 +960,7 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) {
   PointerType *PTy = cast<PointerType>(Callee->getType());
   FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
   if (FTy->isVarArg()) {
-    int ix = FTy->getNumParams() + (isa<InvokeInst>(Callee) ? 2 : 0);
+    int ix = FTy->getNumParams();
     // See if we can optimize any arguments passed through the varargs area of
     // the call.
     for (CallSite::arg_iterator I = CS.arg_begin()+FTy->getNumParams(),