lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lightning] Weird bug in function calls


From: Dhaemon
Subject: Re: [Lightning] Weird bug in function calls
Date: Sat, 29 Dec 2007 17:34:43 -0500

Hi,
Paolo Bonzini wrote:
> This is wrong:
>  jit_calli(printf);
>  jit_finish(display_message);
> jit_finish *includes* jit_calli, as in the original printf.c:

Yes, but the purpose of the 'jit_calli(printf)' is just to show that calling printf works, but not 'display_message'.
In other words, the error still happens when I remove 'jit_calli(printf)'.
Without any modification, the official 'printf.c' fails too.

Regards,
Yann Dauphin

On Dec 29, 2007 4:58 PM, Paolo Bonzini < address@hidden> wrote:
Dhaemon wrote:
> Hi,
> First of all, thanks a lot for this great project.
> I have produced the error on a i686-apple-darwin8 (latest Intel Core Duo
> 2 Macbook) using Apple GCC 4.0.1 with lightning-1.2b.
> Function calls seem to work most of the time but sometime they cause an
> 'Illegal Instruction' error(Unix signal 4).
>
> I found a reliable way to reproduce this error at will. It's pretty weird.
> The following is a slightly modified version of 'printf.c ' in the
> 'tests' directory:
> http://www.step.polymtl.ca/~polyrad/polyrad/printf.c
>
> When compiled with the marked c-call to 'display_message', there is no
> error.

This is wrong:

  jit_calli(printf);
  jit_finish(display_message);

jit_finish *includes* jit_calli, as in the original printf.c:

  jit_prepare_i(2);
    jit_pusharg_i(JIT_R1);              /* push in reverse order */
    jit_pusharg_p(JIT_R0);
  jit_finish(display_message);

lightning does not support (portably) varargs calls.  They might work on
some backends but most likely they won't.  Currently they only work on i386.

Paolo


reply via email to

[Prev in Thread] Current Thread [Next in Thread]