[m-dev.] diff: code generation bug fix

Thomas Charles CONWAY conway at cs.mu.oz.au
Tue Nov 25 13:16:25 AEDT 1997


Fergus Henderson, you write:
> 
> Tom and Zoltan, can you both please review this change?
> 
> Fix a code generation bug that broke Tom's mediancut.m program.
> 
> compiler/code_exprn.m:
> 	Change code_exprn__lval_in_use/3 to also check the registers marked
> 	in use, not just the variables marked in use. 
> 	
> 	This avoids problems in the following case:
> 		- a register R was marked in use, since it was the target
> 		  register we decided to use to compute variable X;
> 		- before variable X was given status `evaled(R)' we had to
> 		  first produce some other variable Y that X depended on;
> 		- Y was placed in register R (since that was not considered
> 		  in use);
> 		- we then assigned X to R, because that was
> 		  the location we had decided to place X in,
> 		  thus clobbering Y;
> 		- subsequently we used R, expecting it to hold Y.
> 
> 	This change increases the code size of the compiler on DEC Alpha
> 	by 100k (2.7%).  :-(
> 

Shame about hte bloat.
The diff looks okay though.

Thomas



More information about the developers mailing list