Re: double float array problem?

Gary Byers <[email protected]> Wed, 10 Jan 2007 15:35:03 -0700 (MST)
Newsgroups gmane.lisp.openmcl.bugs
Message-ID <[email protected]>

On Wed, 10 Jan 2007, J. T.K. wrote:

> Hello,
>
> The following function will not compile in  OpenMCL Version
> 1.1-pre-061231(DarwinPPC32)
> running in OS X 10.4.8
>
> There seem to be some mentions of aref bugs in the mailing lists,
> but this is from a snapshot I downloaded yesterday, and I couldn't find any
> references
> to AREF bugs after 2006-12-31 in the CHANGES file in
> ftp://clozure.com/pub/testing/
>
> I tried to figure out if this is in the latest CVS release, but I did not
> manage to compile the
> CVS distribution, because there is something I don't understand about
> kernels and heap
> images - I got "Heap image is too new for this kernel." when loading
> ppc-boot.image into
> the new CVS dppccl

Hmm.  The 2006-12-31 archives introduced some binary incompatibility
with previous versions, but the message makes it sound like there
was an older kernel involved.

I -think- that everything in the 061231 archives is the correct version;
I'll double-check that.

If you have an older dppccl or openmcl shell script on your path, that
might also explain this error.

If you can run something that announces itself as "061231", then doing:

shell> cd ccl
shell> cvs update # may need to do a one-time "cvs login", with password "cvs"
shell> openmcl
Welcome to ... 061231 ... !
? (rebuild-ccl :full t)

should recompile everything (including the kernel) and create a new
image.

>
> Many thanks,
> Jan
>
>
>
> ;; compiling this fails as shown below
> ;;
> (defun foo (y)
>          (declare (type (simple-array double-float (*)) y))
>          (loop for i below (length y)
>               do (print (aref y i))))
>
>
>> Error: Vinsn DOUBLE->HEAP expects 2 result/argument specs, received 3 .
>> While executing: CCL::MATCH-TEMPLATE-VREGS, in process listener(1).
>> Type :POP to abort, :R for a list of available restarts.
>> Type :? for other options.

ugggh.  I could reproduce this (and fixed it a moment ago; thanks.)

>
>
>
> ;; but changing to generic array fixes things, but single float also breaks
> (defun foo (y)
>          (declare (type (simple-array t (*)) y))
>          (loop for i below (length y)
>               do (print (aref y i))))
> ==> FOO
>

I didn't see a problem with AREF on SINGLE-FLOAT arrays:

? (defun foo (y)
            (declare (type (simple-array single-float (*)) y))
            (loop for i below (length y)
                 do (print (aref y i))))
FOO
? (foo (make-array 5 :element-type 'single-float :initial-contents '(0.0 1.0 2.0 3.0 4.0)))
0.0 
1.0 
2.0 
3.0 
4.0 
NIL
?