[GHC] #10504: GHC panics with dsImpSpecs on SPECIALISE pragma with -fhpc enabled

GHC ghc-devs at haskell.org
Thu Jun 18 11:35:08 UTC 2015


#10504: GHC panics with dsImpSpecs on SPECIALISE pragma with -fhpc enabled
-------------------------------------+-------------------------------------
        Reporter:  nh2               |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Code Coverage     |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash                              |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by nh2):

 Some more info, contributed by a colleague:

 In the minimal example provided:

 {{{
 ghc --show-iface A.hi
 ...
 ef7b9ac4dd27cad757d7fad8ecd0592a
   myfun :: a {- Strictness: b, Inline: INLINABLE[ALWAYS] -}
 # actual end of file
 }}}

 The myfun function doesn't actually have an unfolding in the .hi interface
 file (there's no "Unfolding: ..." line). The seeming inconsistency with an
 import being marked INLINABLE but not having an unfolding is the root
 cause of the bug (see
 https://github.com/ghc/ghc/blob/45d9a15c4b85a2ed89579106bdafd84accf2cb39/compiler/deSugar/DsBinds.hs#L479).

 The hyper-strictness (ie “Strictness: b”, b for bottom a la undefined) is
 probably why the unfolding isn't retained in this minimal example.

 Anothere example of when the unfolding isn't retained is if you use
 `-fomit-inerface-pragmas`.

 My colleague's conclusion:

 These are two ways to trigger the same bug: GHC should not crash on a
 SPECIALIZE for an imported function that has no unfolding, regardless of
 why it has no unfolding. It would always be better to warn about the
 missing unfolding/useless SPECIALISE pragma and then ignore the
 SPECIALISE. Perhaps GHC should also warn about marking a hyperstrict
 definition as INLINABLE.

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


More information about the ghc-tickets mailing list