Profiling with -O2

Simon Marlow simonmar at microsoft.com
Thu Aug 16 06:22:44 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'

The bug doesn't reproduce here, but I suspect it's due to the old
interface file from the previous compilation.  Does it go away if you
also remove the interface files between compilations?

Cheers,
	Simon




More information about the Glasgow-haskell-bugs mailing list