Opened 6 years ago

Closed 5 years ago

#1312 closed defect (fixed)

Compiler bug x862-form to freg #<ACODE nil NIL>

Reported by: rme Owned by:
Priority: normal Milestone:
Component: Compiler Version: 1.11
Keywords: Cc:

Description (last modified by rme)

(load "home:quicklisp;setup")
(ql:quickload :manardb)
(in-package :manardb)
(defun junk () (lisp-object-to-mptr nil))
> Error: Compiler bug or inconsistency:
>        x862-form to freg #<ACODE nil NIL>

Change History (5)

comment:1 Changed 6 years ago by rme

  • Description modified (diff)

comment:2 Changed 6 years ago by gb

In the big oicture, I have no idea what this code is trying to do.

From what I could see in the backtrace at the poinr where the error occurred, it looked as if CCL::SET-FLOAT might be getting called with NIL as an argument, so I tried

(defun foo (p) (setf (ccl::%get-double-float p 0) nil))

hoping to be able to reproduce the error, but that seemed to compile without error.

I then tried again to call (LISP-OBJECT-to-MPTR) and was surprised to see:

? (lisp-object-to-mptr nil)

Error: Unbound variable: TAG While executing: LISP-OBJECT-TO-MPTR, in process listener(1). Type :POP to abort, :R for a list of available restarts. Type :? for other options.

1 > :b *(F6EFED10) : 0 (LISP-OBJECT-TO-MPTR NIL) 5187

around this point. Emacs froze. if/when I get it back.I would want to try to find the source to LISP-OBJECT-TO-MPTR.

comment:3 Changed 5 years ago by rme

I don't really know what the code is trying to do either. It's not clear to me that the code even works. On the other hand, it does seem to me that we have to do something about the error "compiler bug or inconsistency."

The context of this bug may be seen at More specifically, shows that the 1.11 prerelease fails to do (ql:quickload :manardb-test).

Applying the following diff to ccl seems to fix the problem (and the ccl tests still pass), but I have to admit that I don't really understand the implications of what I am doing here. This diff is just copied from the trunk ccl.

Index: compiler/X86/x862.lisp
--- compiler/X86/x862.lisp	(revision 16585)
+++ compiler/X86/x862.lisp	(working copy)
@@ -3705,11 +3705,8 @@
     (x862-push-register seg reg)))
 (defun x862-one-lreg-form (seg form lreg)
-  (let ((is-float (= (hard-regspec-class lreg) hard-reg-class-fpr)))
-    (if is-float
-      (x862-form-float seg lreg nil form)
-      (x862-form seg lreg nil form))
-    lreg))
+  (x862-form seg lreg nil form)
+  lreg)
 (defun x862-one-targeted-reg-form (seg form reg)
   (x862-one-lreg-form seg form reg))

comment:4 Changed 5 years ago by gb

My (dim) memory is that X862-FORM-FLOAT had something to do with the PPC long ago, where long ago there was no (better) way to distinguish between single- and double-floats in the compiler.

I think that "long ago" probably means "sometime in the 1990s, when single-floats were introduced in PPC MCL".

if the test case works on X86 and ARM (where floats are a bit different). I would think that the proposed fix is correct

comment:5 Changed 5 years ago by rme

  • Resolution set to fixed
  • Status changed from new to closed

(In [16629]) Lose {x862,arm2}-form-float, which is probably an old PPC-ism.

Closes ticket:1312.

Note: See TracTickets for help on using tickets.