
#10844: CallStack should not be inlined -------------------------------------+------------------------------------- Reporter: nomeata | Owner: gridaphobe Type: task | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1259 Wiki Page: | -------------------------------------+------------------------------------- Comment (by gridaphobe): Unfortunately the rules don't seem to fire in the right order. The key step appears to be when we get to the following state. {{{ boo = build (\ @ b_aog -> unpackFoldrCString# "foo"#) lvl_spB = \ @ b_aot c_aou n_aov -> foldr c_aou n_aov boo foo = \ x_anI -> augment lvl_spB x_anI }}} At this point, I would want `fold/build` to fire on `lvl_spB`, giving us {{{ lvl_spB = \ @ b_aot c_aou n_aov -> unpackFoldrCString# "foo"# c_aou n_aov }}} followed by `unpack-append` on `foo`, which would finally give us {{{ foo = \ x_anI -> unpackAppendCString# "foo"# x_anI }}} But instead `foldr/app` fires, collapsing `foo` back into a use of `++`. If I add a special rule for `++` on strings {{{ {-# RULES "++-string" forall xs ys. unpackCString# xs ++ ys = unpackAppendCString# xs ys #-} }}} I can coax GHC into generating the same Core as on master, but this is not very satisfying. It seems like we already have all of the necessary rules available. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10844#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler