On 16 January 2005 05:37, Wolfgang Thaller wrote:

> On x86-linux, with the latest HEAD, the following code triggers a
> register allocation bug:
> 
> #include "Cmm.h"
> foo {
>       I32 bar;                                // bar get's assigned to
%eax
>       foreign "C" bar ();     // %eax is correctly saved accross this
call
>       foreign "C" bar ();     // But this call clobbers it.
>       jump bar;                               // here we'll probably
crash.
> }

I think you have a missing 'bar = R1;' here, after the declaration of
bar.

> This gets compiled to:
> 
> .text
>       .align 4,0x90
> .globl foo
> foo:
>       movl %esi,%eax
>       movl %eax,64(%esp)
>       call *%eax
>       addl $0,%esp
>       movl 64(%esp),%eax
>       call *%eax
>       addl $0,%esp
>       jmp *%eax

Thanks, fix committed.

Cheers,
        Simon
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to