Re: BUG: incorrect results with notinline MIN on AMD64

Stas Boukarev <[email protected]>
Newsgroups gmane.lisp.steel-bank.devel
Message-ID <CAF63=10Vhgsa5KZ5sVYwPd+Kxr12LgfPrvgRaFvaqviWWT-mOg@mail.gmail.com>
This might have been already fixed.


On Fri, Dec 5, 2025 at 8:42 PM Eric Marsden via Sbcl-devel
<[email protected]> wrote:
>
> Hi,
>
> This is from random-integer testing on AMD64.
>
> * (lisp-implementation-version)
> "2.5.11.34-373278e4e"
> * (defun foo (a b)
>    (1+
>     (ash a
>          (min 63
>               (deposit-field -10 (byte 15 2)
>                       (expt (if (< a b) a a) 0))))))
> FOO
> * (defun bar (a b)  ; identical except for declaration
>    (declare (notinline min))
>    (1+
>     (ash a
>          (min 63
>               (deposit-field -10 (byte 15 2)
>                              (expt (if (< a b) a a) 0))))))
> BAR
> * (foo -973374182 -2808094898932282)
> 8977792211655191254905389057
> * (bar -973374182 -2808094898932282)
> -8977792211655191254905389055   ;; different result
>
>
> _______________________________________________
> Sbcl-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sbcl-devel


_______________________________________________
Sbcl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.