Eric Marsden <eric.marsden@...> writes:
> While this is fresh in your memory, a possibly related bug (also from pfdietz
> random-integer-testing). This is on AMD64.
> * (lisp-implementation-version)
> * (defun foo (a b)
> (declare (optimize (speed 2) (safety 0)))
> (logand (the (eql 16779072918521075607) a)
> (the (integer 21371810342718833225 21371810343571293860) b)))
> * (- (foo 16779072918521075607 21371810342718833263) 2923729245085762055)
> 18446744073709551616 ;; <-- expected 0
The good news is that I don't think this is as impossible as some of
your other lovely discoveries. It is I think old, and comes as a result
of CUT-TO-WIDTH not looking through CAST nodes: the singleton-typed A
eventually gets replaced by a constant, which then gets cut, but the
variable B does not, leading to the usual off-by-2^64 problems.
Even better, I think Paul is working on a fix. It might involve a
rewrite of CUT-TO-WIDTH, so the assistance of the tester to find all the
new problems likely introduced will be most excellent.