#4978: Continuation passing style loop doesn't compile into a loop
---------------------------------+------------------------------------------
Reporter: tibbe | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.4.1
Component: Compiler | Version: 7.0.1
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Comment(by tibbe):
Replying to [comment:12 batterseapower]:
> Simon's example gets the "correct" arity of 2 if you replace the go_pap
case in exprIsCheap' with (all (exprIsCheap' good_app) args).
This doesn't help in the `Repro3.hs` case above. For reference, this is
the change I applied to GHC:
{{{
diff --git a/compiler/coreSyn/CoreUtils.lhs
b/compiler/coreSyn/CoreUtils.lhs
index 70e1db7..1c86825 100644
--- a/compiler/coreSyn/CoreUtils.lhs
+++ b/compiler/coreSyn/CoreUtils.lhs
@@ -588,7 +588,7 @@ exprIsCheap' good_app other_expr -- Applications
and variables
go _ _ = False
--------------
- go_pap args = all exprIsTrivial args
+ go_pap args = all (exprIsCheap' good_app) args
-- For constructor applications and primops, check that all
-- the args are trivial. We don't want to treat as cheap, say,
-- (1:2:3:4:5:[])
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4978#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs