[commit: ghc] master: bug fix for control-flow optimisation (a2e0fbe)

Simon Marlow marlowsd at gmail.com
Mon Jul 30 15:06:46 CEST 2012


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/a2e0fbe50513da4aa8749c3b2bccc41e73808adf

>---------------------------------------------------------------

commit a2e0fbe50513da4aa8749c3b2bccc41e73808adf
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Mon Jul 30 11:06:09 2012 +0100

    bug fix for control-flow optimisation

>---------------------------------------------------------------

 compiler/cmm/CmmContFlowOpt.hs |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/compiler/cmm/CmmContFlowOpt.hs b/compiler/cmm/CmmContFlowOpt.hs
index 1988169..b2dbef4 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)
 





More information about the Cvs-ghc mailing list