#5256: code in an "else" branch that is never executed still does influence
runtime (Vectorizer?)
-------------------------------+--------------------------------------------
    Reporter:  j.waldmann      |       Owner:              
        Type:  bug             |      Status:  new         
    Priority:  normal          |   Component:  Compiler    
     Version:  7.0.3           |    Keywords:              
    Testcase:                  |   Blockedby:              
          Os:  Linux           |    Blocking:              
Architecture:  x86_64 (amd64)  |     Failure:  None/Unknown
-------------------------------+--------------------------------------------

Comment(by j.waldmann):

 compile:
 {{{
 ghc -O2 -fforce-recomp -threaded -rtsopts bug.hs
 }}}

 run: (with "id")
 {{{
 ./bug 10000000 +RTS -N1
 ("numCap",1)
 5000000
 sum xs 0.250303s
 (5000000,5000000)
 foldb_cap 0.318648s
 (5000000,5000000)
 foldl' 0.026361s
 }}}

 run (with "undefined")
 {{{
 ./bug 10000000 +RTS -N1
 ("numCap",1)
 5000000
 sum xs 0.246084s
 (5000000,5000000)
 foldb_cap 0.03731s
 (5000000,5000000)
 foldl' 0.02679s
 }}}

 notice the drop from 0.3 s to 0.04 s

 {{{
 ghc --info
  [("Project name","The Glorious Glasgow Haskell Compilation System")
  ,("Project version","7.0.3")
  ,("Booter version","6.12.1")
  ,("Stage","2")
  ,("Build platform","x86_64-unknown-linux")
  ,("Host platform","x86_64-unknown-linux")
  ,("Target platform","x86_64-unknown-linux")
  ,("Have interpreter","YES")
  ,("Object splitting","YES")
  ,("Have native code generator","YES")
  ,("Have llvm code generator","YES")
  ,("Support SMP","YES")
  ,("Unregisterised","NO")
  ,("Tables next to code","YES")
  ,("RTS ways","l debug  thr thr_debug thr_l thr_p  dyn debug_dyn thr_dyn
 thr_debug_dyn")
  ,("Leading underscore","NO")
  ,("Debug on","False")
  ,("LibDir","/usr/local/lib/ghc-7.0.3")
  ,("Global Package DB","/usr/local/lib/ghc-7.0.3/package.conf.d")
  ,("C compiler flags","[\"-fno-stack-protector\"]")
  ,("Gcc Linker flags","[]")
  ,("Ld Linker flags","[]")
  ]
 }}}

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