#7507: loop fusion not working for Int32, Int64 as it does for Int ?
-------------------------+--------------------------------------------------
Reporter:  j.waldmann    |          Owner:                
    Type:  bug           |         Status:  new           
Priority:  normal        |      Component:  Compiler      
 Version:  7.6.1         |       Keywords:                
      Os:  Linux         |   Architecture:  x86_64 (amd64)
 Failure:  None/Unknown  |      Blockedby:                
Blocking:                |        Related:                
-------------------------+--------------------------------------------------
 here is some code that works for Int, but gives me Stack Overflow for
 arguments 18 .. 24, and Out of memory for 25. (Just change the
 type annotation in main.)

 {{{
 import Data.Int
 import System.Environment

 bitcount x = if x > 0
     then let (d,m) = divMod x 2 in  bitcount d + m
     else 0

 main = do
     [ arg ]  <- getArgs
     print $ sum  $ map bitcount
           [ 0 :: Int64 .. 2^read arg - 1 ]
 }}}

 https://github.com/haskell-distributed/distributed-
 process/issues/91#issuecomment-11468092

 Not sure whether it's a bug, but it's annoying. There is no conceptual
 difference between these numerical types, so I shouldn't have to rewrite
 my program when switching between them.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7507>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to