Euphoria
Ticket #835:
Intermitently loop counters are not compared to the correct values
-
Reported by
SDPringle
Jan 12, 2013
The problem is invisible interpreted or bound. I am using Linux/32. see test in t_callc.e: Can call and things are passed correctly for ten argument functions: expected: 11739392 got:2.058922583e+14
Details
1. Comment by SDPringle
Jan 12, 2013
It may not be a translator problem but I had to pick some category.
2. Comment by SDPringle
Jan 12, 2013
See: hg:euphoria/rev/709f437126bb
changeset: 5920:709f437126bb tag: tip parent: 5916:9afe4f19af20 user: Shawn Pringle <shawn.pringle@gmail.com> date: Sat Jan 12 22:04:07 2013 -0300 files: source/test818.c tests/t_callc.e description:
- added a test for passing 8 doubles
- this tests order
- ticket 835
3. Comment by SDPringle
Jan 12, 2013
modifying the test to reflect the present understanding of the problem.
4. Comment by SDPringle
Jan 13, 2013
Although the tests were using too many bits, it didn't explain the huge difference in magnitude between the expected value (computed via EUPHORIA) and the outcome value (computed in C). It turns out EUPHORIA translated code was wrong but it doesn't always workout wrong.
5. Comment by SDPringle
Jan 13, 2013
See pastey at http://openeuphoria.org/pastey/190.wc
In particular refer to this code below. _i_14760 is 'i' in EUPHORIA. It is assigned to 1 but when deciding whether to terminate it checks to see if it is greater than 1 intstead of comparing with the length of the sequence. This is why the value returned is equal to the first term in the sum.
/** t_callc.e:80 for i = 1 to length(s) by 2 do*/
_8286 = 1;
{
object _i_14760;
_i_14760 = 1;
L1:
if (_i_14760 > 1){
goto L2; // [13] 90
}
6. Comment by SDPringle
Jan 14, 2013
See: hg:euphoria/rev/0f04e36e40ff
changeset: 5922:0f04e36e40ff parent: 5920:709f437126bb user: Shawn Pringle <shawn.pringle@gmail.com> date: Sun Jan 13 01:23:40 2013 -0300 files: tests/t_callc.e description:
- put a '+' so that EUPHORIA tries to link it using the std calling convention on Windows
- picked the numbers so the calculation can be exact with 64-bit double floats.
- ticket 835
7. Comment by mattlewis
Jan 15, 2013
The problem is with FLOOR, and the problem exists in the 4.0 branch, too.
8. Comment by mattlewis
Jan 16, 2013
See: hg:euphoria/rev/151b625e2a15
changeset: 5936:151b625e2a15 branch: 4.0 parent: 5929:b7e563a517fd user: Matt Lewis date: Wed Jan 16 07:01:00 2013 -0500 files: source/compile.e description:
- fix translator to handle floored sequences properly
- fixes ticket 835
9. Comment by mattlewis
Jan 16, 2013
See: hg:euphoria/rev/2565b491532f
changeset: 5937:2565b491532f branch: 4.0 user: Matt Lewis date: Wed Jan 16 07:01:46 2013 -0500 files: docs/release/4.0.6.txt description:
- release notes for ticket 835