[SelectionDAG] Replace llvm_unreachable at the end of getCopyFromParts with a report_...
authorCraig Topper <craig.topper@intel.com>
Mon, 6 May 2019 04:01:49 +0000 (04:01 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 6 May 2019 04:01:49 +0000 (04:01 +0000)
Based on PR41748, not all cases are handled in this function.

llvm_unreachable is treated as an optimization hint than can prune code paths
in a release build. This causes weird behavior when PR41748 is encountered on a
release build. It appears to generate an fp_round instruction from the floating
point code.

Making this a report_fatal_error prevents incorrect optimization of the code
and will instead generate a message to file a bug report.

llvm-svn: 360008

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

index 225e0d8..bdb5cab 100644 (file)
@@ -322,7 +322,7 @@ static SDValue getCopyFromParts(SelectionDAG &DAG, const SDLoc &DL,
     return DAG.getNode(ISD::FP_EXTEND, DL, ValueVT, Val);
   }
 
-  llvm_unreachable("Unknown mismatch!");
+  report_fatal_error("Unknown mismatch in getCopyFromParts!");
 }
 
 static void diagnosePossiblyInvalidConstraint(LLVMContext &Ctx, const Value *V,