[GHC] #11444: 8.0 rc1 panics in applyTypeToArgs

GHC ghc-devs at haskell.org
Mon Jan 16 14:09:22 UTC 2017


#11444: 8.0 rc1 panics in applyTypeToArgs
-------------------------------------+-------------------------------------
        Reporter:  osa1              |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  8.0.1-rc1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13027            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 That looks like overkill, strictly speaking, but I could definitely
 believe that it doesn't matter. It looks like overkill because if we have

 {{{#!hs
 foo !x !y = case x of
               Con1 p -> let rup1 = reallyUnsafePtrEquality# x y in ...
               Con2 p -> let rup2 = reallyUnsafePtrEquality# x y in ...
 }}}

 then we can safely float out just a drop:

 {{{#!hs
 foo !x !y = let rup1 = reallyUnsafePtrEquality# x y
                 rup2 = reallyUnsafePtrEquality# x y
             in case x of
                  Con1 p -> ...
                  Con2 p -> ...
 }}}

 and then CSE the duplication out. What I don't know is if such a thing
 will ever occur (or matter) in practice, or whether it would be a good
 idea even if it did. I can certainly make the change and add some notes.
 There are some interactions with some discussion in #13027. At present,
 anyway, `reallyUnsafePtrEquality#` is only considered "safe for
 speculation" when its arguments are known to be forced, which sounded
 really weird before, but isn't that precisely when it should be safe to
 float it out? OTOH, this ticket reveals another issue relating to
 polymorphic arguments, so maybe we should make the conservative change?

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


More information about the ghc-tickets mailing list