Hi Richard, On Friday 02 November 2007 00:52:44 Richard B. Kreckel wrote:
Hi!
Remco Bloemen wrote:
Lately i have been implementing a few algorithms from "Modern Computer Algebra". In the process of implementing Z[x] factorization i noticed the following strange behavior:
cl_modint_ring basering = find_modint_ring(2); cl_univpoly_modint_ring ring = find_univpoly_ring(basering); cl_UP_MI x= ring->zero();
(x != ring->zero()) returns false (correct) (x == ring->zero()) returns false (incorrect)
If i first compare x == x the behavior changes:
(x == x) returns true (correct) (x != ring->zero()) returns true (incorrect) (x == ring->zero()) returns false (incorrect)
Attached is a demonstrational program. I'm using cln version 1.1.13 compiled with gcc-4.2.2 on x86 (prescott).
Could someone please tell me if this is fixed in cvs or being worked on?
The bug is still there. I think it can only happen when x is the ring's zero, and only in Z/2Z and only on x86: The culprit seems to be the assembler function compare_loop_up in src/base/digitseq/cl_asm_i386_.cc. It doesn't work properly if the loop is empty.
I just found that out, but it is too late to work on a patch now and I won't have time the next two weeks. Can you, please, try to fix this yourself and send a patch?
Regards -richy.
I have looked at the code, but i could only conclude the following: my assembler is even worse than my german. I'm afraid fixing assembler code is way over my head, otherwise i would have loved to send you a patch. PS: I am moving to a new 64-bits laptop and i can confirm that the bug does not exist there. Kind regards, Remco