dotgnu-libjit
[Top][All Lists]
Advanced

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

[Dotgnu-libjit] A possible libjit bug


From: Simone Campanoni
Subject: [Dotgnu-libjit] A possible libjit bug
Date: Wed, 08 Jun 2011 12:31:25 -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 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

Attachment: libjit_bug.c
Description: Text Data


reply via email to

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