[GHC] #5928: INLINABLE fails to specialize in presence of simple wrapper

GHC ghc-devs at haskell.org
Tue Sep 17 20:25:12 CEST 2013


#5928: INLINABLE fails to specialize in presence of simple wrapper
-------------------------------------+------------------------------------
        Reporter:  tibbe             |            Owner:
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:  7.6.2
       Component:  Compiler          |          Version:  7.4.1
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by simonpj):

 On an email thread Johan points out that calls to `f` do not lead to
 specialised code for `g`, even though `f` has an INLINE pragma:
 {{{
 f = g
 {-# INLINE f #-}

 g :: Hashable a => ...
 g = ...
 {-# INLINABLE g #-}
 }}}
 This was a surprise to me.  And yes, it's because specialisation currently
 occurs before any inlning.

 Currently the first "gentle" pass of simplification does no inlining. But
 I think that is for out-of-date reasons.  If it honoured INLINE pragmas,
 then the above code would work just fine.  But I got diverted, and the
 code is lying around on my disk waiting for attention.  Reviving this
 ticket is a good incentive to get back to it.

 Simon

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



More information about the ghc-tickets mailing list