OK, I didn't know that kind of optimization is done...
That explains also why "imMatr[10, 10] += x" was needed.
Jussi
On 10 July 2012 22:22, Emil Lenngren wrote:
> Because if you only write "x = 0.6 ^ x", that statement is completely
> optimized away, because x is never used later on.
> If yo
Yes, "0.6 ^ x" was the culprit alone ;)
2012/7/10 Emil Lenngren
> Because if you only write "x = 0.6 ^ x", that statement is completely
> optimized away, because x is never used later on.
> If you write "Print 0.6 ^ x", the result of the operation is printed, i.e.
> used.
>
> If you write "Print
Because if you only write "x = 0.6 ^ x", that statement is completely
optimized away, because x is never used later on.
If you write "Print 0.6 ^ x", the result of the operation is printed, i.e.
used.
If you write "Print 0.6 ^ 2", that is optimized to "Print 0.36".
/Emil
2012/7/10 Jussi Lahtinen
Yes it works now.
But "Print 0.6 ^ x" did crash, but "x = 0.6 ^ x" alone did not crash
("imMatr[10, 10] += x" was needed)!
So I wonder was "0.6 ^ x" culprit alone?
Jussi
On 10 July 2012 18:13, Emil Lenngren wrote:
> It should work now in revision #4934!
>
> /Emil
>
> 2012/7/9 Emil Lenngren
It should work now in revision #4934!
/Emil
2012/7/9 Emil Lenngren
> From gdb I disassemble the jit function to this:
> ...
>0x77e3f05c: movabs $0x0,%rax
>0x77e3f066: callq *%rax
> ...
>
> You can see that llvm replaced the llvm.powi.f64 to a null function :/
>
> 2012
>From gdb I disassemble the jit function to this:
...
0x77e3f05c: movabs $0x0,%rax
0x77e3f066: callq *%rax
...
You can see that llvm replaced the llvm.powi.f64 to a null function :/
2012/7/9 Emil Lenngren
> Public Sub Button1_Click()
> test(19)
> End
>
>
> Fast Privat
Public Sub Button1_Click()
test(19)
End
Fast Private Sub test(x As Integer)
Print 0.6 ^ x
End
Does this crash for you as well?
I think there is a bug in llvm or something. It doesn't seem to like that I
call llvm.powi.f64.
I shall see what I can do about it ...
/Emil
2012/7/9 Jussi Lahti
In fact the function can be further reduced to:
c = CInt((0.6 ^ iEta) / sngCached[iEta])
Jussi
On 9 July 2012 21:02, Jussi Lahtinen wrote:
> Finally, here it is isolated. See attachment.
> I don't know why I didn't get it in first try, and yet, I'm not sure what
> is going on...
>
> Gambas 3
Finally, here it is isolated. See attachment.
I don't know why I didn't get it in first try, and yet, I'm not sure what
is going on...
Gambas 3 rev 4921 @ Xubuntu 12.04 64bit
Jussi
JITbug4-0.0.1.tar.gz
Description: GNU Zip compressed data