From: simonpj Date: Wed, 17 Oct 2001 11:50:38 +0000 (+0000) Subject: [project @ 2001-10-17 11:50:38 by simonpj] X-Git-Tag: Approximately_9120_patches~814 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=670e5f97ce7367ce47ac13164eca98cd2d1e853a;p=ghc-hetmet.git [project @ 2001-10-17 11:50:38 by simonpj] -------------------------- nullAddr# fix for the HEAD [missed one file] -------------------------- *** DO NOT MERGE *** nullAddr# is simply a name for (Lit nullAddrLit). Up to now it has been a PrimOp with the rather stange type nullAddr# :: Int# -> Addr# which discards its argument. (I think the problem with nullary primops is to do with the top-level bindings in PrelPrimOpWrappers.) And there was a RULE in PrelRules to rewrite nullAddr _ ==> nullAddrLit It's excessive to make it a PrimOp. We can just treat it like unsafeCoerce#, which is made in MkId.lhs. So I've done that, and given it the more sensible type nullAddr# :: Addr# I fixed all the occurrences I could find. --- diff --git a/ghc/compiler/nativeGen/StixPrim.lhs b/ghc/compiler/nativeGen/StixPrim.lhs index 45461ca..fecca7e 100644 --- a/ghc/compiler/nativeGen/StixPrim.lhs +++ b/ghc/compiler/nativeGen/StixPrim.lhs @@ -147,12 +147,6 @@ primCode [res] Int2WordOp [arg] primCode [res] Word2IntOp [arg] = simpleCoercion IntRep res arg -primCode [res] AddrNullOp [arg] - = let - assign = StAssign AddrRep (amodeToStix res) (StInt 0) - in - returnUs (\xs -> assign : xs) - primCode [res] AddrToHValueOp [arg] = simpleCoercion PtrRep res arg