Skip to content

Commit e99ee06

Browse files
committed
[X86] Reject fpsr in inline asm constraints other than clobber.
Fixes #73197 and #69201.
1 parent b16f765 commit e99ee06

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57236,7 +57236,8 @@ X86TargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
5723657236
return std::make_pair(X86::DF, &X86::DFCCRRegClass);
5723757237

5723857238
// fpsr -> FPSW
57239-
if (StringRef("{fpsr}").equals_insensitive(Constraint))
57239+
// Only allow for clobber.
57240+
if (StringRef("{fpsr}").equals_insensitive(Constraint) && VT == MVT::Other)
5724057241
return std::make_pair(X86::FPSW, &X86::FPCCRRegClass);
5724157242

5724257243
return Res;

0 commit comments

Comments
 (0)