conts, handlers, and liveness

Matthew Fluet mfluet@intertrust.com
Wed, 18 Jul 2001 10:19:48 -0700 (PDT)


Around line 150 in live.fun (computing liveness of CPS variables in the
backend), there is the following expression:

			 val _ =
			    (* In case there is a raise to j. *)
			    if isCont
			       then
				  case jumpHandlers name of
				     h :: _ =>
					Block.addEdge (argBlock,
						       #argBlock (jumpInfo h))
				   | _ => ()
			    else ()

I believe that this is introducing bogus flow.  If the block isCont (i.e.,
is the continuation of a non-tail call), then the block should do nothing
but adjust the stack top (not actually added until codegen), maybe do a
limit check, and then do a jump to the actual continuation (i.e., the
continuation that appears in the .cps).  If the actual continuation
raises, then it will do a jump to the handler block and the flow edge will
be added by the Raise case of the transfer.  With this edge, I'm seeing
that everything live down to the handler is also live at the
continuation, even though the actual continuation does not raise.