summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-07-30 11:06:09 +0100
committerSimon Marlow <marlowsd@gmail.com>2012-07-30 11:56:21 +0100
commita2e0fbe50513da4aa8749c3b2bccc41e73808adf (patch)
tree8da9bf0e07106934e5ed23752a783be039170f2e
parent938833720a5a3cf65ddf74a54da2f4f9f6629c97 (diff)
downloadhaskell-a2e0fbe50513da4aa8749c3b2bccc41e73808adf.tar.gz
bug fix for control-flow optimisation
-rw-r--r--compiler/cmm/CmmContFlowOpt.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/cmm/CmmContFlowOpt.hs b/compiler/cmm/CmmContFlowOpt.hs
index 1988169155..b2dbef49da 100644
--- a/compiler/cmm/CmmContFlowOpt.hs
+++ b/compiler/cmm/CmmContFlowOpt.hs
@@ -33,9 +33,14 @@ cmmCfgOptsProc (CmmProc info lbl g) = CmmProc info' lbl g'
info' = info{ info_tbls = new_info_tbls }
new_info_tbls = mapFromList (map upd_info (mapToList (info_tbls info)))
+ -- If we changed any labels, then we have to update the info tables
+ -- too, except for the top-level info table because that might be
+ -- referred to by other procs.
upd_info (k,info)
| Just k' <- mapLookup k env
- = (k', info{ cit_lbl = infoTblLbl k' })
+ = (k', if k' == g_entry g'
+ then info
+ else info{ cit_lbl = infoTblLbl k' })
| otherwise
= (k,info)