[GHC] #9390: Inlining prevents evaluation of ignored parts of unboxed tuples

GHC ghc-devs at haskell.org
Fri Aug 1 05:00:21 UTC 2014


#9390: Inlining prevents evaluation of ignored parts of unboxed tuples
-------------------------------------+-------------------------------------
              Reporter:  snoyberg    |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:
             Component:  Compiler    |          Version:  7.8.3
            Resolution:              |         Keywords:
      Operating System:  Linux       |     Architecture:  x86_64 (amd64)
       Type of failure:  Incorrect   |       Difficulty:  Unknown
  result at runtime                  |       Blocked By:
             Test Case:              |  Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by snoyberg):

 Note that the following similar code does not reproduce this issue:

 {{{#!hs
 import GHC.IO (IO (..))
 import GHC.Prim

 writeB :: MutableArray# RealWorld Char -> ()
 writeB arr# =
     case writeArray# arr# 0# 'B' realWorld# of
         _ -> ()

 test :: IO Char
 test = IO $ \s0# ->
   case newArray# 1# 'A' s0# of
     (# s1#, arr# #) ->
       case seq# (writeB arr#) s1# of
         (# s2#, () #) ->
           readArray# arr# 0# s2#

 main :: IO ()
 main = test >>= print
 }}}

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


More information about the ghc-tickets mailing list