NOINLINE pragma ignored
Compile the following program
{-# OPTIONS_GHC -O -ddump-simpl #-}
module F(test) where
class AsInt a where
{-# NOINLINE toInt #-}
toInt :: a -> Int
{-# NOINLINE fromInt #-}
fromInt :: Int -> a
{-# INLINE onInt #-}
onInt :: AsInt a => (Int -> Int) -> (a -> a)
onInt f x = fromInt (f (toInt x))
test :: AsInt a => (Int -> Int) -> (Int -> Int) -> (a -> a)
test h g = onInt h . onInt g
Look at the final output for test:
F.test =
\ (@ a_a6c)
($dAsInt_a6m :: F.AsInt a_a6c)
(eta_s6B :: GHC.Base.Int -> GHC.Base.Int)
(eta1_s6C :: GHC.Base.Int -> GHC.Base.Int)
(eta2_s6D :: a_a6c) ->
case $dAsInt_a6m of tpl_B1 { F.:DAsInt tpl1_B2 tpl2_B3 ->
tpl2_B3 (eta_s6B (tpl1_B2 (tpl2_B3 (eta1_s6C (tpl1_B2 eta2_s6D)))))
The method (selectors) toInt and fromInt have been inlined despite the NOINLINE pragma. The compiler should either obey the pragma, or tell me that I can't have it in that place.
Trac metadata
Trac field | Value |
---|---|
Version | 6.9 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | lennart@augustsson.net |
Operating system | Unknown |
Architecture | Unknown |