[GHC] #9254: Entered absent argument (again)

GHC ghc-devs at haskell.org
Mon Jun 30 16:50:43 UTC 2014


#9254: Entered absent argument (again)
------------------------------------+-------------------------------------
       Reporter:  simonpj           |             Owner:
           Type:  bug               |            Status:  new
       Priority:  normal            |         Milestone:  7.8.4
      Component:  Compiler          |           Version:  7.8.2
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 Consider this program:
 {{{
 {-# LANGUAGE MagicHash, UnboxedTuples #-}
 module Main where
 import GHC.Exts

 f :: (() -> (# Int#, () #)) -> ()
 {-# NOINLINE f #-}
 -- Strictness signature was (7.8.2)
 --    <C(S(LS)), 1*C1(U(A,1*U()))>
 -- I.e. calls k, but discards first component of result
 f k = case k () of (# _, r #) -> r

 g :: Int -> ()
 g y = f (\n -> (# case y of I# y2 -> h (h (h (h (h (h (h y2)))))), n #))
    -- RHS is big enough to force worker/wrapper

 {-# NOINLINE h #-}
 h :: Int# -> Int#
 h n = n +# 1#

 main = print (g 1)
 }}}
 You'll get
 {{{
 bash$ ghc -O -o foo Foo.hs
 bash$ ./foo
 foo: Oops!  Entered absent arg w_s4vl Int
 }}}
 Ugh!  This is the bug underlying [https://github.com/bos/vector-binary-
 instances/issues/4 this bug report].

 I know what is going on.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9254>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list