[X86] Prevent assertion when calling a function that returns double with -mno-sse2...
authorCraig Topper <craig.topper@intel.com>
Wed, 18 Sep 2019 01:57:46 +0000 (01:57 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 18 Sep 2019 01:57:46 +0000 (01:57 +0000)
As seen in the most recent updates to PR10498

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372197 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index 9c16c173523f9128a5d4aea0b49fc0b584e46ce4..f40e29b3cd4bb125bd307d6880295c4905fa8e7c 100644 (file)
@@ -2900,6 +2900,10 @@ SDValue X86TargetLowering::LowerCallResult(
         ((Is64Bit || Ins[InsIndex].Flags.isInReg()) && !Subtarget.hasSSE1())) {
       errorUnsupported(DAG, dl, "SSE register return with SSE disabled");
       VA.convertToReg(X86::FP0); // Set reg to FP0, avoid hitting asserts.
+    } else if (CopyVT == MVT::f64 &&
+               (Is64Bit && !Subtarget.hasSSE2())) {
+      errorUnsupported(DAG, dl, "SSE2 register return with SSE2 disabled");
+      VA.convertToReg(X86::FP0); // Set reg to FP0, avoid hitting asserts.
     }
 
     // If we prefer to use the value in xmm registers, copy it out as f80 and