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

Bug #1716731 reported by Paul F. Dietz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

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

(defun ftest2 ()
  (let* ((body
   '(typep
     (logxor
      (logior b -1048580)
      6016598896514910121
      c)
     '(integer 0 979952933957413849)))
  (f1
   `(lambda (b c)
      (declare (type (integer -964745090048 -375825891943) c))
      (declare (optimize (speed 0) (safety 3)
    (space 0) (compilation-speed 1)))
      ,body))
  (f2
   `(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))

Revision history for this message
Stas Boukarev (stassats) wrote :

it's (NIL NIL) here.

Changed in sbcl:
status: New → Incomplete
Revision history for this message
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.

Revision history for this message
Stas Boukarev (stassats) wrote :

The current HEAD.

Revision history for this message
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.

Revision history for this message
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 <http://www.sbcl.org/>.

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*

(:64-BIT :64-BIT-REGISTERS :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS
 :C-STACK-IS-CONTROL-STACK :COMMON-LISP :COMPACT-INSTANCE-HEADER
 :COMPARE-AND-SWAP-VOPS :COMPLEX-FLOAT-VOPS :CYCLE-COUNTER :ELF :FLOAT-EQL-VOPS
 :FP-AND-PC-STANDARD-SAVE :GENCGC :IEEE-FLOATING-POINT :IMMOBILE-CODE
 :IMMOBILE-SPACE :INLINE-CONSTANTS :INTEGER-EQL-VOP :LARGEFILE :LINKAGE-TABLE
 :LINUX :LITTLE-ENDIAN :MEMORY-BARRIER-VOPS :MULTIPLY-HIGH-VOPS
 :OS-PROVIDES-BLKSIZE-T :OS-PROVIDES-DLADDR :OS-PROVIDES-DLOPEN
 :OS-PROVIDES-GETPROTOBY-R :OS-PROVIDES-POLL :OS-PROVIDES-PUTWC
 :OS-PROVIDES-SUSECONDS-T :PACKAGE-LOCAL-NICKNAMES :PRECISE-ARG-COUNT-ERROR
 :RAW-INSTANCE-INIT-VOPS :RAW-SIGNED-WORD :RELOCATABLE-HEAP :SB-DOC :SB-EVAL
 :SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS :SB-SIMD-PACK :SB-SOURCE-LOCATIONS
 :SB-THREAD :SB-TRACEROOT :SB-UNICODE :SBCL :STACK-ALLOCATABLE-CLOSURES
 :STACK-ALLOCATABLE-FIXED-OBJECTS :STACK-ALLOCATABLE-LISTS
 :STACK-ALLOCATABLE-VECTORS :STACK-GROWS-DOWNWARD-NOT-UPWARD :SYMBOL-INFO-VOPS
 :UNBIND-N-VOP :UNDEFINED-FUN-RESTARTS :UNIX :UNWIND-TO-FRAME-AND-CALL-VOP
 :X86-64)

Revision history for this message
Paul F. Dietz (paul-f-dietz) wrote :

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

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.