Re: Another stumper compilation diagnostic

Raymond Toy <[email protected]>
Newsgroups gmane.lisp.cmucl.general
Message-ID <[email protected]>
Madhu wrote:
> Sorry. Actually I was able to reproduce this under 
> 
>        (optimize (speed 3) (space 0)) 
> 
> settings.  The MOD and REM come from NTHCDR in list.lisp. 
> 
> 
> Here is a reduced test case:
> 
> * (defun f (x) (declare (optimize (speed 3)(space 0)))
>    (append (nthcdr 1 x) (nthcdr 1 x)))
> 
> * (compile 'f)
> 
> I can't explain it from looking at srctran.lisp's deftransform for
> nthcdr.

My guess.  nthcdr is declared maybe-inline.  Since speed > space (or
maybe space = 0 or something like that), nthcdr is inlined.  And that
happens before the deftransform for nthcdr is ever gets a chance.

Easy enough to put an inhibit-warnings in the offending part of nthcdr.
 Not sure if we really want to.

Or just don't compile the code with speed 3 and space 0.  I've never
really noticed much speed up with speed 3 on code that manipulates
lists.  But I don't manipulates lists that much.

Ray
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.