
#14272: GHC goes out of memory while compiling simple program with optimizations -------------------------------------+------------------------------------- Reporter: 39aldo39 | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.4.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4021, Wiki Page: | Phab:D4025 -------------------------------------+------------------------------------- Changes (by bgamari): * differential: Phab:D4021 => Phab:D4021, Phab:D4025 Comment: Alright, so the problem is fairly obvious: after some amount of simplification we end up with `... (GHC.Prim.uncheckedIShiftL# 1# x_a3q9) ...`. After a bit more simplification we learn (due to case analysis) that `x_a3q9 = 9223372036854775807#`. This allows the `uncheckedIShiftL#` constant folding rule to fire, which then blows up as the result is absurdly large. This is fixed by adding another constant folding rule to catch this case (which should result in `0#`). This is done in Phab:D4025. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14272#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler