#6131: -fprof-auto adds cost centers to INLINE functions
-----------------------------------------+----------------------------------
 Reporter:  akio                         |          Owner:                
     Type:  bug                          |         Status:  new           
 Priority:  normal                       |      Component:  Compiler      
  Version:  7.4.2-rc1                    |       Keywords:                
       Os:  Linux                        |   Architecture:  x86_64 (amd64)
  Failure:  Incorrect result at runtime  |       Testcase:                
Blockedby:                               |       Blocking:                
  Related:                               |  
-----------------------------------------+----------------------------------
 According to the Section 5.2 of User's Guide, -fprof-auto should add cost
 centers only to functions that are not marked INLINE. However GHC 7.4
 doesn't respect this.

 A simple example:

 {{{
 foo :: Integer -> Integer
 foo x = x + 100
 {-# INLINE foo #-}

 main = print $ loop (10000000::Int) 10000000000000000000000
     where
         loop 0 x = x
         loop n x = loop (n-1) (foo x)
 }}}

 Compile and run this like:

 {{{
 % ghc -prof -fprof-auto -O2 test.hs
 % ./test +RTS -p
 % grep foo test.prof
 }}}

 And you will see 'foo' is listed as a cost center.

 This happens with GHC 7.4.1 and 7.4.2-rc1

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6131>
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