From: Craig Topper Date: Mon, 17 Aug 2020 06:27:41 +0000 (-0700) Subject: [X86] Reject dirflag in inline asm constraints other than clobber. X-Git-Tag: llvmorg-13-init~14576 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a206f8509124c483358eb6e80e08bf621efd7655;p=platform%2Fupstream%2Fllvm.git [X86] Reject dirflag in inline asm constraints other than clobber. Fixes the crash from PR47195. --- diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 961fd08..05da599 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -50285,7 +50285,8 @@ X86TargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, return std::make_pair(X86::EFLAGS, &X86::CCRRegClass); // dirflag -> DF - if (StringRef("{dirflag}").equals_lower(Constraint)) + // Only allow for clobber. + if (StringRef("{dirflag}").equals_lower(Constraint) && VT == MVT::Other) return std::make_pair(X86::DF, &X86::DFCCRRegClass); // fpsr -> FPSW