remove-unused

Matthew Fluet fluet@CS.Cornell.EDU
Fri, 26 Oct 2001 18:19:13 -0400 (EDT)


> fun x_17 (env_47: unit, x_545: (pointer * int)): (string) = L_462()
>   makes a tail call to x_547
>   but x_17's call points never make use of the return value
> 
> fun x_547 (env_62: unit, x_668: char array): (string) = L_577()
>  is tail called from other functions besides x_17, some of which do make
> use of the return value.
> 
> So, x_547's return type doesn't change, but x_17's does.
> 
> Can I turn x_17's tail call of x_547 into a non-tail call with a
> continuation that does nothing but forget the arguments and return?
> Essentially, in addition to bugCont we would have returnCont that does
> nothing but return the right values and wrappers that coordinate between
> callees that return extra stuff.  Nothing is live down the returnCont, so
> I don't think there is a safe-for-space issue with introducing a non-tail
> call.  We do waste a little space on stack because of the non-tail call.

Short term fix: add
flowVarTysVarTys(returnsFunc func, returnsFunc f);
to case return of NONE in the Call case of visitTransfer (in addition to
the flowVarTysVarTys that is alread there). This will ensure that callers
and tail callees always have the same return types.