[project @ 2001-08-20 16:50:13 by simonpj]
authorsimonpj <unknown>
Mon, 20 Aug 2001 16:50:13 +0000 (16:50 +0000)
committersimonpj <unknown>
Mon, 20 Aug 2001 16:50:13 +0000 (16:50 +0000)
commit0c190d9efcf76845241f756a1507267458b90c90
treedbc8d5b275cb01226c2ecd8869e3f6711767df43
parent014170298065b672ee5664c34cb44dba1f736346
[project @ 2001-08-20 16:50:13 by simonpj]
-------------------------------------
Make NOINLINE zap the strictness info
-------------------------------------

Make a NOINLINE pragma zap strictness information.
Reasons given in the WorkWrap comment:

-- Furthermore, zap the strictess info in the Id.  Why?  Because
-- the NOINLINE says "don't expose any of the inner workings at the call
-- site" and the strictness is certainly an inner working.
--
-- More concretely, the demand analyser discovers the following strictness
-- for unsafePerformIO:  C(U(AV))
-- But then consider
-- unsafePerformIO (\s -> let r = f x in
--        case writeIORef v r s of (# s1, _ #) ->
--        (# s1, r #)
-- The strictness analyser will find that the binding for r is strict,
-- (becuase of uPIO's strictness sig), and so it'll evaluate it before
-- doing the writeIORef.  This actually makes tests/lib/should_run/memo002
-- get a deadlock!
--
-- Solution: don't expose the strictness of unsafePerformIO.

This fixes the memo002 deadlock.
ghc/compiler/basicTypes/Id.lhs
ghc/compiler/stranal/WorkWrap.lhs