#5779: SPECIALISE pragma generates wrong activations
--------------------------------------+-------------------------------------
  Reporter:  rl                       |          Owner:                  
      Type:  bug                      |         Status:  closed          
  Priority:  normal                   |      Milestone:                  
 Component:  Compiler                 |        Version:  7.5             
Resolution:  invalid                  |       Keywords:                  
        Os:  Unknown/Multiple         |   Architecture:  Unknown/Multiple
   Failure:  Runtime performance bug  |     Difficulty:  Unknown         
  Testcase:                           |      Blockedby:                  
  Blocking:                           |        Related:                  
--------------------------------------+-------------------------------------
Changes (by simonpj):

  * status:  new => closed
  * difficulty:  => Unknown
  * resolution:  => invalid


Comment:

 On the contrary it's vital that specialisations don't kick in too early.
 Imagine that `foo` had a rule
 {{{
 RULE "foo/bar"  forall x. foo (bar x) = x
 }}}
 You put a NOINLINE pragma on `foo` to make sure it isn't inlined too
 early, to make sure that the RULE gets to fire.  But you'd be annoyed if
 the SPECIALISE pragma rewrite `foo` to `foo_spec`, and thereby stopped the
 RULE firing!

 Happily you can add a phase to the SPECIALISE pragma, thus:
 {{{
 {-# SPECIALISE [1] foo :: Int -> Int #-}
 }}}
 which should let you do as you want.  This behaviour, and the override
 mechanism, are documented:
 http://www.haskell.org/ghc/dist/current/docs/html/users_guide/pragmas.html
 #specialize-pragma.  If the documenation is unclear (all too possible)
 could you suggest better wording?  Thanks.

 Simon

 Yell if that doesn't do the job

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to