From: simonpj Date: Mon, 4 Jun 2001 16:47:06 +0000 (+0000) Subject: [project @ 2001-06-04 16:47:06 by simonpj] X-Git-Tag: Approximately_9120_patches~1812 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=59aaef6b00115e7a30e017362bdbc4475d8637d9;p=ghc-hetmet.git [project @ 2001-06-04 16:47:06 by simonpj] ---------------------------------- Fix an existential-constructor bug ---------------------------------- MERGE INTO 5.00.2 This fixes a long-standing bug that made the strictness analyser go into a loop if it met a recursive newtype: newtype Void = MkVoid Void --- diff --git a/ghc/compiler/stranal/SaAbsInt.lhs b/ghc/compiler/stranal/SaAbsInt.lhs index 47afd99..4cef8c9 100644 --- a/ghc/compiler/stranal/SaAbsInt.lhs +++ b/ghc/compiler/stranal/SaAbsInt.lhs @@ -713,6 +713,10 @@ findRecDemand str_fn abs_fn ty -- we don't exploit it yet, so don't bother Just (tycon,_,data_con,cmpnt_tys) -- Single constructor case + | isRecursiveTyCon tycon -- Recursive data type; don't unpack + -> wwStrict -- (this applies to newtypes too: + -- e.g. data Void = MkVoid Void) + | isNewTyCon tycon -- A newtype! -> ASSERT( null (tail cmpnt_tys) ) let @@ -721,7 +725,6 @@ findRecDemand str_fn abs_fn ty wwUnpackNew demand | null compt_strict_infos -- A nullary data type - || isRecursiveTyCon tycon -- Recursive data type; don't unpack -> wwStrict | otherwise -- Some other data type