Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,403
    • Issues 5,403
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 595
    • Merge requests 595
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #7507
Closed
Open
Issue created Dec 18, 2012 by waldmann@imn.htwk-leipzig.de@trac-waldmann

loop fusion not working for Int32, Int64 as it does for Int ?

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.

Trac metadata
Trac field Value
Version 7.6.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking