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: Aleksey Demakov
Subject: Re: [Dotgnu-libjit] A possible libjit bug
Date: Sat, 2 Jul 2011 03:14:55 +0700

Hi Simone,

The attached patch should fix the problem.

I only tested it with your testcase and libjit "make check"
though. I gather you have a big test suite, so please check
if the patch stands against it.

Regards,
Aleksey


On Thu, Jun 23, 2011 at 7:37 PM, Simone Campanoni <address@hidden> wrote:
> 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: x86shift.patch
Description: Binary data


reply via email to

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