summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/RegAlloc/Linear/Main.hs
diff options
context:
space:
mode:
authorbenl@ouroborus.net <unknown>2010-06-23 08:50:02 +0000
committerbenl@ouroborus.net <unknown>2010-06-23 08:50:02 +0000
commit20142a7dfd176c4f587adb21e1d0161018f1ec7f (patch)
treed9572192be6b4f618881c62aa6ea441608f5c982 /compiler/nativeGen/RegAlloc/Linear/Main.hs
parentaf6e6c7022596e69b6aa0269cca18d7b8b1dcbf7 (diff)
downloadhaskell-20142a7dfd176c4f587adb21e1d0161018f1ec7f.tar.gz
NCG: Emit a warning on unreachable code block instead of panicing
Diffstat (limited to 'compiler/nativeGen/RegAlloc/Linear/Main.hs')
-rw-r--r--compiler/nativeGen/RegAlloc/Linear/Main.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/nativeGen/RegAlloc/Linear/Main.hs b/compiler/nativeGen/RegAlloc/Linear/Main.hs
index 29cc0e5f7f..63f2814d5d 100644
--- a/compiler/nativeGen/RegAlloc/Linear/Main.hs
+++ b/compiler/nativeGen/RegAlloc/Linear/Main.hs
@@ -206,15 +206,16 @@ linearRA_SCCs first_id block_live blocksAcc (CyclicSCC blocks : sccs)
some reason then this function will loop. We should probably do some
more sanity checking to guard against this eventuality.
-}
-
+
process _ _ [] [] accum _
= return $ reverse accum
process first_id block_live [] next_round accum madeProgress
| not madeProgress
- = pprPanic "RegAlloc.Linear.Main.process: no progress made, bailing out"
- ( text "stalled blocks:"
+ = pprTrace "RegAlloc.Linear.Main.process: no progress made, bailing out."
+ ( text "Unreachable blocks:"
$$ vcat (map ppr next_round))
+ $ return $ reverse accum
| otherwise
= process first_id block_live
@@ -380,9 +381,9 @@ genRaInsn block_live new_instrs block_id instr r_dying w_dying =
clobber_saves <- saveClobberedTemps real_written r_dying
-- debugging
- freeregs <- getFreeRegsR
+{- freeregs <- getFreeRegsR
assig <- getAssigR
-{- pprTrace "genRaInsn"
+ pprTrace "genRaInsn"
(ppr instr
$$ text "r_dying = " <+> ppr r_dying
$$ text "w_dying = " <+> ppr w_dying