dotgnu-libjit
[Top][All Lists]
Advanced

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

Re: [Dotgnu-libjit] A possible libjit bug


From: Simone Campanoni
Subject: Re: [Dotgnu-libjit] A possible libjit bug
Date: Thu, 23 Jun 2011 08:37:56 -0400
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10

Hi Aleksey,
    you right, I forgot to write the details of my environment.
The CPU is Intel i7 with Ubuntu 11.04.
Libjit has been compiled for a 32 bits machine (with the "-m32" flag of
gcc).
To compile Libjit I have used gcc 4.5.2 coming from the Ubuntu distribution.

I attach the Libjit intermediate representation dumped with
jit_dump_function and the correspondent assembly instructions.

Thanks,
Simone

On 06/22/2011 04:43 PM, Aleksey Demakov wrote:
> Hi Simone,
>
> Thanks for the bug report. Could you please provide the
> details of your environment (cpu, os, gcc version) as in
> my setup your test case worked fine.
>
> Regards,
> Aleksey
>
> On Wed, Jun 8, 2011 at 11:31 PM, Simone Campanoni <address@hidden> wrote:
>> Hi all,
>>    I attach the minimum C program I could find that shows a possible
>> bug on Libjit.
>> I am using the current git version of the library.
>>
>> The program store 0 to a variable called "shift_amount_var".
>> It performs some operations that do not change the value of that
>> variable and finally it returns "shift_amount_var".
>> The result should be 0, but it is 1 instead.
>>
>> My guess is that the problem is on the register allocation of Libjit
>> because the libjit intermediate seems correct to me.
>> On the other hand, the assembly seems wrong because it uses a register
>> for two variables: shift_amount_var and an intermediate result.
>> The intermediate result is modified during the operations and therefore
>> the return instruction (which uses the shared register) returns the
>> modified value instead of shift_amount_var.
>>
>> I hope you will find useful the attached test.
>>
>> Thanks,
>> Simone Campanoni
>>
>> _______________________________________________
>> Dotgnu-libjit mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/dotgnu-libjit
>>
>>

Attachment: libjit
Description: Text document

Attachment: output
Description: Text document

Attachment: machine_code
Description: Text document


reply via email to

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