[GHC] #8467: Stack overflow when optimizing recursive newtype
#8467: Stack overflow when optimizing recursive newtype ------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- I have {{{ module Bug where newtype Void = Void Void data Decision a = Disproved (a -> Void) foo :: () -> Decision Int foo _ = Disproved (\_ -> undefined) }}} When I {{{
ghc -O Bug.hs }}}
I get {{{ [1 of 1] Compiling Bug ( Bug.hs, Bug.o ) stack overflow: use +RTS -K<size> to increase it }}} The module compiles fine without `-O`. This was tested on 7.7.20131011. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8467> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8467: Stack overflow when optimizing recursive newtype -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"bf90df6b9db345a7f12c6d37d801c0f8e9864411/testsuite"]: {{{ #!CommitTicketReference repository="testsuite" revision="bf90df6b9db345a7f12c6d37d801c0f8e9864411" Test Trac #8467 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8467#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8467: Stack overflow when optimizing recursive newtype -------------------------------------------------+------------------------- Reporter: goldfire | Owner: Type: bug | Status: Priority: normal | closed Component: Compiler | Milestone: Resolution: fixed | Version: 7.7 Operating System: Unknown/Multiple | Keywords: Type of failure: None/Unknown | Architecture: Test Case: stranal/should_compile/T8467 | Unknown/Multiple Blocking: | Difficulty: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Changes (by simonpj): * status: new => closed * testcase: => stranal/should_compile/T8467 * resolution: => fixed Comment: Thank you for this nice small test case. Fixed. Simon -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8467#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8467: Stack overflow when optimizing recursive newtype -------------------------------------------------+------------------------- Reporter: goldfire | Owner: Type: bug | Status: Priority: normal | closed Component: Compiler | Milestone: Resolution: fixed | Version: 7.7 Operating System: Unknown/Multiple | Keywords: Type of failure: None/Unknown | Architecture: Test Case: stranal/should_compile/T8467 | Unknown/Multiple Blocking: | Difficulty: | Unknown | Blocked By: | Related Tickets: -------------------------------------------------+------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"2650da2b8b744248c2529d8c5969b78cd97239d3/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="2650da2b8b744248c2529d8c5969b78cd97239d3" Refactor the topNormaliseNewType story, fixing Trac #8467 A bit of a mess had accumulated, with unclear invariants. * Remove splitNewTypeRepCo_maybe, in favour of topNormaliseNewType_maybe (which had the same signature but behaved subtly differently). * Make topNormaliseNewType_maybe guaranteed to return a non-newtype if it says (Just ty). This is what was causing the loop in #8467 * Apply similar tidying up to FamInstEnv.topNormaliseType }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8467#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC