gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: more on that documentation bug


From: Camm Maguire
Subject: [Gcl-devel] Re: more on that documentation bug
Date: 19 Jun 2006 14:15:11 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!  The doc bug should be gone now too.  Please let me know if
problems persist.

Take caare,

Robert Boyer <address@hidden> writes:

> Getting a fresh copy of 2.7.0 did not make that
> 'documentation' bug go away.  Below is a greatly simplified
> form of the bug.  It looks like there is something very
> simple wrong in the compilation of 'cond' or 'typep' in some
> situations.
> 
> 1.  Please note that I'm using CLTL1, not ANSI here.
> 
> 2.  The compiled code for the very simple function 'funny'
>     below is clearly incorrect.
> 
> 3.  As always, I may well have stupidly screwed up anything
>     in the configure or build.  Or maybe I'm just going blind.
> 
> Bob
> 
> -------------------------------------------------------------------------------
> 
> % bin/gcl
> GCL (GNU Common Lisp)  2.7.0 CLtL1    Jun  9 2006 18:03:07
> Source License: LGPL(gcl,gmp,pargcl), GPL(unexec,bfd)
> Binary License:  GPL due to GPL'ed components: (READLINE BFD UNEXEC)
> Modifications of this banner must retain notice of a compatible license
> Dedicated to the memory of W. Schelter
> 
> Use (help) to get some basic information on how to use GCL.
> 
> Temporary directory for compiler files set to /tmp/
> 
> >(defun funny (object)
>   (cond ((typep object 'function) 1)
>       ((typep object 'package) 2)))
> 
> FUNNY
> 
> >(disassemble 'funny)
> 
> ;; Compiling /tmp/gazonk_14219_0.lsp.
> ;; End of Pass 1.  
> ;; End of Pass 2.  
> ;; OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3, 
> (Debug quality ignored)
> ;; Finished compiling /tmp/gazonk_14219_0.o.
> 
> #include "gazonk_14219_0.h"
> void init_code(){do_init(VV);}
> /*    local entry for function FUNNY  */
> 
> static fixnum LI1(V2)
> 
> register object V2;
> {      VMB1 VMS1 VMV1
>       goto TTL;
> TTL:;
>       if(!(({enum type _tp=type_of((V2));_tp>=t_ifun && _tp<=t_closure;}))){
>       goto T2;}
>       {fixnum V3 = (fixnum)1;
>       VMR1(V3);}
>       goto T2;
> T2:;
>       {fixnum V4 = (fixnum)2;
>       VMR1(V4);}
> }
>        
> #(
> USER
> LISPLAMBDA!,OBJEC,DECLAR,OPTIMIZ,SAFETY
> !,IF        !,TYPEP!,QUOTE,FUNCTION
> .     /0,PACKAGE
> )
> 
> static fixnum LI1();
> #define VMB1
> #define VMS1
> #define VMV1
> #define VMR1(VMT1) return(VMT1);
> #define VM1 0
> static char * VVi[1]={
> #define Cdata VV[0]
> (char *)(LI1)
> };
> #define VV ((object *)VVi)
> 
> /tmp/gazonk_14219_0.o:     file format elf32-i386
> 
> Disassembly of section .text:
> 
> 00000000 <init_code>:
> init_code():
>    0: 68 00 00 00 00          push   $0x0
>    5: e8 fc ff ff ff          call   6 <init_code+0x6>
>    a: 58                      pop    %eax
>    b: c3                      ret    
> 
> 0000000c <LI1>:
> LI1():
>    c: 8b 54 24 04             mov    0x4(%esp),%edx
>   10: b8 0f 00 00 00          mov    $0xf,%eax
>   15: 81 fa 00 00 00 00       cmp    $0x0,%edx
>   1b: 74 26                   je     43 <LI1+0x37>
>   1d: 81 fa ff ff ff bf       cmp    $0xbfffffff,%edx
>   23: b8 01 00 00 00          mov    $0x1,%eax
>   28: 77 19                   ja     43 <LI1+0x37>
>   2a: 0f b6 02                movzbl (%edx),%eax
>   2d: 24 01                   and    $0x1,%al
>   2f: 84 c0                   test   %al,%al
>   31: 74 0e                   je     41 <LI1+0x35>
>   33: 81 3a ff ff ff bf       cmpl   $0xbfffffff,(%edx)
>   39: 77 06                   ja     41 <LI1+0x35>
>   3b: 0f be 42 01             movsbl 0x1(%edx),%eax
>   3f: eb 02                   jmp    43 <LI1+0x37>
>   41: 31 c0                   xor    %eax,%eax
>   43: 83 e8 14                sub    $0x14,%eax
>   46: 83 f8 07                cmp    $0x7,%eax
>   49: 0f 97 c0                seta   %al
>   4c: 0f b6 c0                movzbl %al,%eax
>   4f: 40                      inc    %eax
>   50: c3                      ret    
> NIL
> 
> >(compile 'funny)
> 
> ;; Compiling /tmp/gazonk_14219_0.lsp.
> ;; End of Pass 1.  
> ;; End of Pass 2.  
> ;; OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3, 
> (Debug quality ignored)
> ;; Finished compiling /tmp/gazonk_14219_0.o.
> Loading /tmp/gazonk_14219_0.o
> start address -T 0x88274f8 Finished loading /tmp/gazonk_14219_0.o
> #<compiled-function FUNNY>
> NIL
> NIL
> 
> >(funny 'foo)
> 
> 2
> 
> >(defun funny (object)
>   (cond ((typep object 'function) 1)
>       ((typep object 'package) 2)))
> 
> FUNNY
> 
> >(funny 'foo)
> 
> NIL
> 
> >
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]