From 9bca583f9d674eb27f492d46074f5621dd166f5a Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Fri, 23 May 2008 01:01:31 +0000 Subject: [PATCH] Allow for switch with no cases. Was causing fault in gcc.dg/pr27531-1.c. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51464 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/SCCP.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index 9c17b77954e..79cda33f793 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -1379,6 +1379,8 @@ bool SCCPSolver::ResolvedUndefsIn(Function &F) { if (!getValueState(BI->getCondition()).isUndefined()) continue; } else if (SwitchInst *SI = dyn_cast(TI)) { + if (SI->getNumSuccessors()<2) // no cases + continue; if (!getValueState(SI->getCondition()).isUndefined()) continue; } else { -- 2.34.1