From 983b869a8333c66b4e1a07c9ba1fefc5bddbd173 Mon Sep 17 00:00:00 2001 From: "benl@ouroborus.net" Date: Wed, 23 Jun 2010 09:12:09 +0000 Subject: [PATCH] NCG: Handle stripping of liveness info from procs with no blocks (like stg_split_marker) --- compiler/nativeGen/RegAlloc/Liveness.hs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/compiler/nativeGen/RegAlloc/Liveness.hs b/compiler/nativeGen/RegAlloc/Liveness.hs index 18dd01a..a4eeafc 100644 --- a/compiler/nativeGen/RegAlloc/Liveness.hs +++ b/compiler/nativeGen/RegAlloc/Liveness.hs @@ -447,9 +447,8 @@ slurpReloadCoalesce live -- | Strip away liveness information, yielding NatCmmTop - stripLive - :: Instruction instr + :: (Outputable instr, Instruction instr) => LiveCmmTop instr -> NatCmmTop instr @@ -470,8 +469,14 @@ stripLive live in CmmProc info label params (ListGraph $ map stripLiveBlock $ first' : rest') - stripCmm _ - = panic "RegAlloc.Liveness.stripLive: no first_id on proc" + -- procs used for stg_split_markers don't contain any blocks, and have no first_id. + stripCmm (CmmProc (LiveInfo info Nothing _) label params []) + = CmmProc info label params (ListGraph []) + + -- If the proc has blocks but we don't know what the first one was, then we're dead. + stripCmm proc + = pprPanic "RegAlloc.Liveness.stripLive: no first_id on proc" (ppr proc) + -- | Strip away liveness information from a basic block, -- and make real spill instructions out of SPILL, RELOAD pseudos along the way. -- 1.7.10.4