Profiling with -O2

Saswat Anand saswatan at comp.nus.edu.sg
Wed Aug 15 05:33:22 EDT 2001


Hi,
  After stripping down my code, I found the following fragments that
reproduce the error. The code makes no sense though.

Thanks,
Saswat

--Main.hs
module Main(main) where
import Bug

main = buggy "strange"
	  

--Bug.hs
module Bug(buggy) where
			    
buggy :: String -> IO ()
buggy cs =  fun 1 cs
  where 
        fun _ [] = return ()
	fun index s =  case index of
			      0 -> do print "Wow"
				      fun 2 s
-------------------------------------------------------------
[saswat at localhost bug]$ touch *.hs
[saswat at localhost bug]$ ghc -prof -auto-all Bug.hs Main.hs -o Main
[saswat at localhost bug]$ touch *.hs
[saswat at localhost bug]$ ghc -O2 Bug.hs Main.hs -o Main
[saswat at localhost bug]$ touch *.hs
[saswat at localhost bug]$ ghc -prof -auto-all -O2 Bug.hs Main.hs -o Main

Main.hs:1:
    Failed to find interface decl for `Bug.lit1'
    from module `Bug'
[saswat at localhost bug]$ 








More information about the Glasgow-haskell-bugs mailing list