logo       

ffloor-derived-type-optimizer: msg#00283

lisp.cmucl.devel

Subject: ffloor-derived-type-optimizer

gerd.moellmann@xxxxxxxxxxx (Gerd Moellmann) writes:

> (defun foo (n d)
> (declare (type (unsigned-byte 32) n d))
> (ffloor n d))

CL-USER ==> (trace c::ffloor-derive-type-optimizer)
CL-USER ==> (cl "/tmp/ffloor" :byte-compile t)

; Python version 1.1, VM version Intel x86 on 25 AUG 03 07:19:47 pm.
; Compiling: /usr/tmp/ffloor.lisp 25 AUG 03 04:01:23 pm


0: (c::ffloor-derive-type-optimizer
#<c::combination #x482AA715
fun= #<c::ref #x482AA6E5
leaf= #<c::defined-function #x482AA675
name= ffloor
inlinep= :inline>>
args= (#<c::ref #x482AA78D
leaf= #<c::lambda-var #x482AA20D
name= n
type= #1=#<numeric-type #>>>
#<c::ref #x482AA805
leaf= #<c::lambda-var #x482AA25D name= d type= #1#>>)>)
0: c::ffloor-derive-type-optimizer returned
#<values-type (values (rational 0) (mod 4294967295))>

CL-USER ==> (in-package :c)
#<The C package, 3817/6255 internal, 310/390 external>
COMPILER ==> (values-type-intersection
(values-specifier-type '(values (rational 0) (mod 4294967295)))
(values-specifier-type '(values float real)))
#<named-type nil>

That's why Python thinks FOO's return type is NIL. Compiling the file
natively, C::FFLOOR-DERIVE-TYPE-OPTIMIZER is not called, which
probably explains the difference in behavior.

Someone knowing that part of the code intimately enough to spot the
bug immediately?




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise