diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-02-23 17:45:15 +0000 |
---|---|---|
committer | Ben Gamari <ben@well-typed.com> | 2021-04-02 18:21:32 -0400 |
commit | efdf2c6684f92202a6aa19e996f7ef0724492fb5 (patch) | |
tree | 772a78be7a92c8dc431be37bc2dd2a8b55fb480b | |
parent | 1742206fa120caf8137a8f5dc4e26f0c0802ec29 (diff) | |
download | haskell-wip/coretostg.tar.gz |
Force stg_arg in CoreToStgwip/coretostg
Otherwise we build up a list of thunks which just immediately get
forced.
-rw-r--r-- | compiler/GHC/CoreToStg.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/GHC/CoreToStg.hs b/compiler/GHC/CoreToStg.hs index bf58cc1377..2e8ed2e716 100644 --- a/compiler/GHC/CoreToStg.hs +++ b/compiler/GHC/CoreToStg.hs @@ -601,7 +601,9 @@ coreToStgArgs (arg : args) = do -- Non-type argument arg' <- coreToStgExpr arg let (aticks, arg'') = stripStgTicksTop tickishFloatable arg' - stg_arg = case arg'' of + -- Force this now, as otherwise the returned [StgArg]s contains + -- thunks which we will eventually force anyway. + !stg_arg = case arg'' of StgApp v [] -> StgVarArg v StgConApp con _ [] _ -> StgVarArg (dataConWorkId con) StgLit lit -> StgLitArg lit |