Incorrect value computed in code with IF, LOGAND, LOGXOR, *, ELT

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

Bug Description

(defparameter *f365*
  '(if (not
        (or c
         (if t
             nil
             t)))
    (logand (elt '(14089144940) (min 0 (max 0 0)))
     (logxor
      (* 5
         (if c
             0
             1152921504606846975))
      -264592622 -16 -928 -2270558))
    0))

(defun f365 ()
  (let* ((form *f365*)
         (vars '(c))
         (vals '(nil))
         (opt-decls
          '((declare (optimize (safety 3)))))
         (unopt-decls
          '((declare (notinline * logxor max min elt logand not))))
         (opt-lam
          `(lambda ,vars ,@opt-decls ,form))
         (unopt-lam
          `(lambda ,vars ,@unopt-decls ,form)))
    (values
     (apply (compile nil opt-lam) vals)
     (apply (compile nil unopt-lam) vals))))

(f365) ==> 0, 13958643784

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

This bug occurs in 1.4.7, so it's not very recent.

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

This occurs in 1.4.2, but not 1.4.1.

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

5c78c2ca33f821c54527e032ae68eddeaeae23aa

Changed in sbcl:
status: New → Fix Committed
Stas Boukarev (stassats)
Changed in sbcl:
status: Fix Committed → 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.