[MLton] PowerPC/AIX regression in trunk

Matthew Fluet fluet at tti-c.org
Sun Jun 24 11:21:56 PDT 2007


Ville Laurikari wrote:
> On Sun, Jun 24, 2007 at 07:20:17AM -0500, Matthew Fluet wrote:
>> I added more type-checking to the RSSA and Machine ILs a couple of
>> months ago.
>> Could you try compiling with "-show-types true"?
> 
> Here we go, "mlton -type-check true -show-types true regression/1.sml":
>   invalid operand: OW8 (x_0, 3): [Word2, Bits6]
>   invalid statement: x_1: [Word2, Bits6] = OW8 (x_0, 3): [Word2, Bits6]
>   invalid block: L_0 (x_0: Objptr (opt_11)) Jump =
>                    x_2: Objptr (opt_11) = OP (x_0, 4): Objptr (opt_11)
>                    x_1: [Word2, Bits6] = OW8 (x_0, 3): [Word2, Bits6]
>                    L_1 (x_2, x_1)
>   Rssa.typeCheck

The Objptr (opt_11) type corresponds to:
   opt_11 = Normal {hasIdentity = false, ty = [Word2, Bits30, Objptr 
(opt_11)]

The type error is due to the type-checker not being endian aware.  The 
type-checker thinks that 8-bits at a 3-byte offset of opt_11 is a Bits8. 
  That is correct for a little-endian machine, but for a big-endian 
PowerPC, then 8-bits at a 3-byte offset of opt_11 is really [Word2, 
Bits6], as expected by the result type.

I've checked-in a stop-gap fix, to skip type-checking the offset on 
big-endian platforms.





More information about the MLton mailing list