From 898a57b6f701d546004017e049cd4434d0675c6d Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 6 May 2019 04:01:49 +0000 Subject: [PATCH] [SelectionDAG] Replace llvm_unreachable at the end of getCopyFromParts with a report_fatal_error. 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360008 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 225e0d847dc..bdb5cabe592 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -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, -- 2.40.0