[MLton] Re: [MLton-commit] r7224

Matthew Fluet mtf at cs.rit.edu
Tue Sep 15 07:11:34 PDT 2009


On Mon, 14 Sep 2009, Wesley Terpstra wrote:
> The applyPrim function incorrectly optimized rol/ror.
>
> The problem stems from confusing the wordsize of the left and right arguments.
>
> The optimization should check if the rol/ror is a multiple of the left
> wordsize, replacing the rol/ror by identity. However, as it incorrectly took
> the right wordsize, a shift by 32 was considered identity for a 64 bit value.

Looks like the bug was introduced with r2125 (20030623), which added 
multiple Int, Real, and Word sizes to the compiler.  The shift amount has 
always been a Word32, but in the absence of 64bit values, this simply 
meant that we weren't optimizing rol/ror on Word16 and Word8 for mod16 and 
mod8 values respectively.



More information about the MLton mailing list