summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2011-02-15 14:36:55 +0000
committersimonpj@microsoft.com <unknown>2011-02-15 14:36:55 +0000
commitc406b5bde899dd2b28e5239937c909d675bca356 (patch)
tree47b3767c3a8ea4cffc19dc58bcdb6afc73137bd0 /compiler
parentf95abb477e0bea25b4016df9565d1c7fe1e6e9f5 (diff)
downloadhaskell-c406b5bde899dd2b28e5239937c909d675bca356.tar.gz
Ensure exprIsCheap/exprIsExpandable deal with Cast properly
This bug was causing a Lint error on the stable branch. For some reason it doesn't show up in HEAD, but it's still worth fixing. The point is that ((f `cast` co) a) is cheap if f has arity>1. This was being gratuitously missed before.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/coreSyn/CoreUtils.lhs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/coreSyn/CoreUtils.lhs b/compiler/coreSyn/CoreUtils.lhs
index b50cb01ca3..c901fc2ef0 100644
--- a/compiler/coreSyn/CoreUtils.lhs
+++ b/compiler/coreSyn/CoreUtils.lhs
@@ -563,6 +563,7 @@ exprIsCheap' good_app other_expr -- Applications and variables
= go other_expr []
where
-- Accumulate value arguments, then decide
+ go (Cast e _) val_args = go e val_args
go (App f a) val_args | isRuntimeArg a = go f (a:val_args)
| otherwise = go f val_args