Comment 1 for bug 1903512

Revision history for this message
Christophe Rhodes (csr21-cantab) wrote : Re: [Bug 1903512] [NEW] Compiler notes in FFLOOR

Michał Herda <email address hidden> writes:

> (defun fmod (number divisor)
> (declare (optimize speed) (double-float number divisor))
> (nth-value 1 (ffloor number divisor)))
>
> This generates several "deleting unreachable code" notes and the
> following note that mentions that the double-float gets boxed:

I think the return-value boxing note is unavoidable. The large number
of unreachable code deletion notes are because the heuristic for whether
a deletion note is interesting to the user or not works quite badly if
both the user (you) and the compiler use the same variable names.
Normally the package system protects you from that, but when some
variables are named by symbols in the CL package there's the likelihood
of collision.

If you rename your first argument N (or something that isn't cl:number),
most of the notes go away. (SBCL should almost certainly not use
exported variable names like this in its transforms, which would make
this much less visible to users).