[project @ 2001-10-17 11:50:38 by simonpj]
authorsimonpj <unknown>
Wed, 17 Oct 2001 11:50:38 +0000 (11:50 +0000)
committersimonpj <unknown>
Wed, 17 Oct 2001 11:50:38 +0000 (11:50 +0000)
--------------------------
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.

ghc/compiler/nativeGen/StixPrim.lhs

index 45461ca..fecca7e 100644 (file)
@@ -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