summaryrefslogtreecommitdiff
path: root/ghc/compiler/codeGen
diff options
context:
space:
mode:
authorsimonpj <unknown>1999-05-28 19:24:42 +0000
committersimonpj <unknown>1999-05-28 19:24:42 +0000
commitf016a43fcbcca53a284e8d6206705ed468a97736 (patch)
tree87a79f81e278e1a73efdcedfe7446da2220c7a21 /ghc/compiler/codeGen
parent29ad936c0443b6af87c26e19d61d1352ac5e7f3e (diff)
downloadhaskell-f016a43fcbcca53a284e8d6206705ed468a97736.tar.gz
[project @ 1999-05-28 19:24:26 by simonpj]
Enable rules for simplification of SeqOp Fix a related bug in WwLib that made it look as if the binder in a case expression was being demanded, when it wasn't.
Diffstat (limited to 'ghc/compiler/codeGen')
-rw-r--r--ghc/compiler/codeGen/CgTailCall.lhs15
1 files changed, 11 insertions, 4 deletions
diff --git a/ghc/compiler/codeGen/CgTailCall.lhs b/ghc/compiler/codeGen/CgTailCall.lhs
index 168cde42ae..96ceff561b 100644
--- a/ghc/compiler/codeGen/CgTailCall.lhs
+++ b/ghc/compiler/codeGen/CgTailCall.lhs
@@ -1,7 +1,7 @@
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-% $Id: CgTailCall.lhs,v 1.19 1999/05/13 17:30:58 simonm Exp $
+% $Id: CgTailCall.lhs,v 1.20 1999/05/28 19:24:28 simonpj Exp $
%
%********************************************************
%* *
@@ -47,7 +47,7 @@ import CmdLineOpts ( opt_DoSemiTagging )
import Id ( Id, idType, idName )
import DataCon ( DataCon, dataConTyCon, dataConTag, fIRST_TAG )
import Const ( mkMachInt )
-import Maybes ( assocMaybe )
+import Maybes ( assocMaybe, maybeToBool )
import PrimRep ( PrimRep(..) )
import StgSyn ( StgArg, GenStgArg(..) )
import Type ( isUnLiftedType )
@@ -390,7 +390,8 @@ doTailCall
-> (Sequel->Code) -- code to perform jump
-> Int -- number of "fast" stack arguments
-> AbstractC -- pending assignments
- -> Maybe VirtualSpOffset -- sp offset to trim stack to
+ -> Maybe VirtualSpOffset -- sp offset to trim stack to:
+ -- USED iff destination is a let-no-escape
-> Bool -- node points to the closure to enter
-> Code
@@ -449,7 +450,13 @@ doTailCall arg_amodes arg_regs finish_code arity pending_assts
-- push a return address if necessary
-- (after the assignments above, in case we clobber a live
-- stack location)
- pushReturnAddress eob `thenC`
+
+ -- DONT push the return address when we're about
+ -- to jump to a let-no-escape: the final tail call
+ -- in the let-no-escape will do this.
+ (if (maybeToBool maybe_join_sp)
+ then nopC
+ else pushReturnAddress eob) `thenC`
-- Final adjustment of stack pointer
adjustRealSp final_sp `thenC`