diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -6879,9 +6879,11 @@ CI->setTailCallKind(TCK); CI->setCallingConv(CC); if (FMF.any()) { - if (!isa(CI)) + if (!isa(CI)) { + CI->deleteValue(); return Error(CallLoc, "fast-math-flags specified for call without " "floating-point scalar or vector return type"); + } CI->setFastMathFlags(FMF); } CI->setAttributes(PAL);