[GHC] #13558: Inconsistency in `CoreUtils.exprIsOk`
#13558: Inconsistency in `CoreUtils.exprIsOk` -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Consider {{{ f1 = \x y -> let t = case x of True -> let v = Just y in (v, v) False -> (Nothing, Nothing) in \w -> t f2 = \x y -> let t = case x of True -> (Just y, Just y) False -> (Nothing, Nothing) in \w -> t }}} We give `f1` arity 1, but `f2` gets arity 2. That's bizarre, because all we've done is turn a `let` into a function application. Reason: in `CoreUtils.exprIsOk`, we recursively apply `go` in the `App` case, but we fail unconditionally in the `Let` case. That is simply inconsistent, and it bit me when trying something else. Incidentally `exprIsOk` is badly named. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13558> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13558: Inconsistency in CoreUtils.exprIsOk -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13558#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13558: Inconsistency in CoreUtils.exprIsOk -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"8d8d094d45fc638e3fac332fbce8138a1c06b9c3/ghc" 8d8d094d/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="8d8d094d45fc638e3fac332fbce8138a1c06b9c3" Make let and app consistent in exprIsCheapX This fixes Trac #13558, by making App and Let behave consistently; see Note [Arguments and let-bindings exprIsCheapX] I renamed the mysterious exprIsOk to exprIsCheapX. (The "X" is because it is parameterised over a CheapAppFun.) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13558#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13558: Inconsistency in CoreUtils.exprIsOk -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13558#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC