Compile to wrong code with typep, logxor and logior (type related?)

Bug #1716731 reported by Paul F. Dietz on 2017-09-12
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

;;; Compilation error in SBCL 1.3.21, 64 bit x86 Linux

(defun ftest2 ()
  (let* ((body
      (logior b -1048580)
     '(integer 0 979952933957413849)))
   `(lambda (b c)
      (declare (type (integer -964745090048 -375825891943) c))
      (declare (optimize (speed 0) (safety 3)
    (space 0) (compilation-speed 1)))
   `(lambda (b c) ,body))
  (args '(-41489895528326 -881385360196))
  (result1 (apply (compile nil f1) args))
  (result2 (apply (compile nil f2) args)))
    (list result1 result2)))

;; (ftest) ==> (T NIL) (should have been (NIL NIL))

Stas Boukarev (stassats) wrote :

it's (NIL NIL) here.

Changed in sbcl:
status: New → Incomplete
Paul F. Dietz (paul-f-dietz) wrote :

Is that in the release version, or your current working copy? Could be the bug has been fixed since 1.3.21 release.

Stas Boukarev (stassats) wrote :

The current HEAD.

Paul F. Dietz (paul-f-dietz) wrote :

Ok, my guess is it has been fixed, or possibly some other change causes it to not occur on this input. I'll check it again in 1.3.22.

Paul F. Dietz (paul-f-dietz) wrote :

BTW, this was the --version and *FEATURES* for the image I had the failure in:

% sbcl --version
SBCL 1.3.21
% sbcl
This is SBCL 1.3.21, an implementation of ANSI Common Lisp.
More information about SBCL is available at <>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* *features*


Paul F. Dietz (paul-f-dietz) wrote :

This is working fine in 1.4.0, so this ticket can be closed.

Stas Boukarev (stassats) on 2017-10-02
Changed in sbcl:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers