[MLton] Problem with MinGW

Wesley W. Terpstra terpstra@gkec.informatik.tu-darmstadt.de
Fri, 9 Jun 2006 03:08:21 +0200


First off, the patch fixes the problem.

'make clean' doesn't remove mllex and mlyacc. Is there a reason for  
this? It just bit me.

Also, mlyacc uses TextIO.openOut and this is creating read-only  
files. Intentional?

Regression suite is running while I sleep. :-)

On Jun 9, 2006, at 12:29 AM, Matthew Fluet wrote:
> So, the actual reason that the open call fails may be that it is  
> reading the wrong arguments off the stack (because we put the wrong  
> arguments there).

At first I was going to say: This is not right, as the runtime makes  
the system call, not the assembler. Therefore, the value is being  
promoted to a 32 bit integer as required by the wrapper. The only  
artifact carried over into the windows system call is the misaligned  
stack.

Then I realized that gcc might be smart enough to turn the runtime  
function call into a tail-call, thus leaving the (bad) mode on the  
stack unchanged for the system method.

>> It's just that by adding a pushw, my patch might also be construed  
>> as promoting the 16 bit value to 32 bits.
>
> Correct.  Though gcc seems to prefer zero-extending to 32-bits over  
> other ways of getting the bits in the right place on the stack.   
> We'll do the same in the native codegen.

Sounds good!