[GHC] #11224: Program doesn't preserve semantics after pattern synonym inlining.

GHC ghc-devs at haskell.org
Tue Dec 15 20:00:47 UTC 2015


#11224: Program doesn't preserve semantics after pattern synonym inlining.
-------------------------------------+-------------------------------------
        Reporter:  anton.dubovik     |                Owner:
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.0.1
       Component:  Compiler          |              Version:  7.10.2
      Resolution:                    |             Keywords:
                                     |  PatternSynonyms
Operating System:  Windows           |         Architecture:  x86_64
 Type of failure:  Incorrect result  |  (amd64)
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #11225            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by mpickering):

 The relevant function which is definitely wrong..

 {{{
 foo :: String -> Int
 [LclId, Str=DmdType]
 foo =
   letrec {
     foo_a2FH :: String -> Int
     [LclId, Str=DmdType]
     foo_a2FH =
       \ (ds_d3kN :: String) ->
         let {
           fail_d3m5 :: Void# -> Int
           [LclId, Str=DmdType]
           fail_d3m5 = \ (ds_d3m6 [OS=OneShot] :: Void#) -> I# 666# } in
         $mPRead
           @ 'Lifted
           @ Int
           @ Int
           $dRead_a2FJ
           ds_d3kN
           (\ (x_aqu :: Int) ->
              let {
                xs_aqv :: [Int]
                [LclId, Str=DmdType]
                xs_aqv = x_aqu } in
              x_aqu)
           (\ (void_0E :: Void#) -> fail_d3m5 void#); } in
   foo_a2FH
 }}}

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


More information about the ghc-tickets mailing list