#5779: SPECIALISE pragma generates wrong activations
-------------------------------------+--------------------------------------
Reporter: rl | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.5 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: Runtime performance bug | Testcase:
Blockedby: | Blocking:
Related: |
-------------------------------------+--------------------------------------
It seems that in the current HEAD, the `SPECIALISE` pragma generates a
rule with the same activation as the function that is being specialised
which is utterly wrong. A small example:
{{{
foo :: Num a => a -> a
{-# NOINLINE foo #-}
foo x = x+1
{-# SPECIALISE foo :: Int -> Int #-}
}}}
The HEAD generates this rule which never fires:
{{{
"SPEC T.foo" [NEVER] forall $dNum :: GHC.Num.Num GHC.Types.Int
T.foo @ GHC.Types.Int $dNum = T.foo_foo
}}}
If I change the `NOINLINE` pragma to `INLINE [0]`, the rule will get the
activation `[0]`. 7.2.2 behaves as expected:
{{{
"SPEC T.foo" [ALWAYS] forall $dNum :: GHC.Num.Num GHC.Types.Int
T.foo @ GHC.Types.Int $dNum = T.foo_foo
}}}
I haven't checked 7.4 but if this happens there, too, then fixing it
before the release would be great. I assume it's just a typo somewhere.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5779>
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